mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 17:53:35 +02:00
parent
91fab05bfb
commit
b9d4cc0c5c
3 changed files with 26 additions and 1 deletions
13
db/migrate/20170424115801_add_unique_index_to_zone_origin.rb
Normal file
13
db/migrate/20170424115801_add_unique_index_to_zone_origin.rb
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
class AddUniqueIndexToZoneOrigin < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
execute <<-SQL
|
||||||
|
ALTER TABLE zones ADD CONSTRAINT unique_zone_origin UNIQUE (origin)
|
||||||
|
SQL
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
execute <<-SQL
|
||||||
|
ALTER TABLE zones DROP CONSTRAINT unique_zone_origin
|
||||||
|
SQL
|
||||||
|
end
|
||||||
|
end
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20170422142116) do
|
ActiveRecord::Schema.define(version: 20170424115801) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -1143,4 +1143,6 @@ ActiveRecord::Schema.define(version: 20170422142116) do
|
||||||
t.text "a4_records"
|
t.text "a4_records"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "zones", ["origin"], name: "unique_zone_origin", unique: true, using: :btree
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -3952,6 +3952,14 @@ ALTER TABLE ONLY settings
|
||||||
ADD CONSTRAINT settings_pkey PRIMARY KEY (id);
|
ADD CONSTRAINT settings_pkey PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: unique_zone_origin; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY zones
|
||||||
|
ADD CONSTRAINT unique_zone_origin UNIQUE (origin);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||||
--
|
--
|
||||||
|
@ -5221,3 +5229,5 @@ INSERT INTO schema_migrations (version) VALUES ('20170422130054');
|
||||||
|
|
||||||
INSERT INTO schema_migrations (version) VALUES ('20170422142116');
|
INSERT INTO schema_migrations (version) VALUES ('20170422142116');
|
||||||
|
|
||||||
|
INSERT INTO schema_migrations (version) VALUES ('20170424115801');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue