mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
parent
cee51e1ac5
commit
0f6a47d73d
47 changed files with 644 additions and 640 deletions
|
@ -0,0 +1,17 @@
|
|||
class AddRegistrarsUniqueConstraints < ActiveRecord::Migration
|
||||
def up
|
||||
execute <<-SQL
|
||||
ALTER TABLE registrars ADD CONSTRAINT unique_name UNIQUE (name);
|
||||
ALTER TABLE registrars ADD CONSTRAINT unique_reference_no UNIQUE (reference_no);
|
||||
ALTER TABLE registrars ADD CONSTRAINT unique_code UNIQUE (code);
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
execute <<-SQL
|
||||
ALTER TABLE registrars DROP CONSTRAINT unique_name;
|
||||
ALTER TABLE registrars DROP CONSTRAINT unique_reference_no;
|
||||
ALTER TABLE registrars DROP CONSTRAINT unique_code;
|
||||
SQL
|
||||
end
|
||||
end
|
6
db/migrate/20180309053921_remove_registrars_indexes.rb
Normal file
6
db/migrate/20180309053921_remove_registrars_indexes.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
class RemoveRegistrarsIndexes < ActiveRecord::Migration
|
||||
def change
|
||||
remove_index :registrars, name: :index_registrars_on_code
|
||||
remove_index :registrars, name: :index_registrars_on_legacy_id
|
||||
end
|
||||
end
|
|
@ -0,0 +1,9 @@
|
|||
class AddRegistrarsNotNullConstraints < ActiveRecord::Migration
|
||||
def change
|
||||
change_column_null :registrars, :name, false
|
||||
change_column_null :registrars, :reg_no, false
|
||||
change_column_null :registrars, :country_code, false
|
||||
change_column_null :registrars, :email, false
|
||||
change_column_null :registrars, :code, false
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue