From 3416c96dc1e06d60337039ac60ffa7a06ca310fd Mon Sep 17 00:00:00 2001 From: Gonzalo Riestra Date: Mon, 17 Feb 2020 19:16:52 +0100 Subject: [PATCH] fix migrations --- .../20121110180905_remove_blank_tags.rb | 4 ++-- db/migrate/20200217133010_drop_oauth_nonce.rb | 21 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/db/migrate/20121110180905_remove_blank_tags.rb b/db/migrate/20121110180905_remove_blank_tags.rb index 040f65be6d..e9f5ca6874 100644 --- a/db/migrate/20121110180905_remove_blank_tags.rb +++ b/db/migrate/20121110180905_remove_blank_tags.rb @@ -1,8 +1,8 @@ Sequel.migration do up do - Tag.db.run("DELETE FROM tags where name = ''") + run "DELETE FROM tags where name = ''" end - + down do end end diff --git a/db/migrate/20200217133010_drop_oauth_nonce.rb b/db/migrate/20200217133010_drop_oauth_nonce.rb index adada61464..5e208a655d 100644 --- a/db/migrate/20200217133010_drop_oauth_nonce.rb +++ b/db/migrate/20200217133010_drop_oauth_nonce.rb @@ -1,16 +1,19 @@ -Sequel.migration do - up do - drop_table :oauth_nonces - end +require 'carto/db/migration_helper' - down do +include Carto::Db::MigrationHelper + +migration( + Proc.new do + drop_table :oauth_nonces + end, + Proc.new do create_table :oauth_nonces do Uuid :id, primary_key: true String :nonce Integer :timestamp - DateTime :created_at, :null => false - DateTime :updated_at, :null => false - index [:nonce, :timestamp], :unique => true + DateTime :created_at, null: false + DateTime :updated_at, null: false + index [:nonce, :timestamp], unique: true end end -end +) \ No newline at end of file