diff options
| author | vlatka pavisic | 2016-11-09 17:18:53 +0100 |
|---|---|---|
| committer | vlatka pavisic | 2016-11-09 17:19:00 +0100 |
| commit | d2cf8812a285e3ff1b59b4f431411cb4faf28483 (patch) | |
| tree | 6af133c3b571c1adbd33e3badcf9e5bef5a5407b /db | |
| parent | 721532c9fb90ea55851dff8d51bfa29dd3209c4c (diff) | |
| download | chouette-core-d2cf8812a285e3ff1b59b4f431411cb4faf28483.tar.bz2 | |
Refs #1927 : Organisation#code uniqueness
Diffstat (limited to 'db')
| -rw-r--r-- | db/migrate/20161109160857_add_organisation_code_index.rb | 5 | ||||
| -rw-r--r-- | db/schema.rb | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/db/migrate/20161109160857_add_organisation_code_index.rb b/db/migrate/20161109160857_add_organisation_code_index.rb new file mode 100644 index 000000000..89d9e67c2 --- /dev/null +++ b/db/migrate/20161109160857_add_organisation_code_index.rb @@ -0,0 +1,5 @@ +class AddOrganisationCodeIndex < ActiveRecord::Migration + def change + add_index :organisations, :code, unique: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 3e877de49..012a86d76 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20161024135931) do +ActiveRecord::Schema.define(version: 20161109160857) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -362,6 +362,8 @@ ActiveRecord::Schema.define(version: 20161024135931) do t.hstore "sso_attributes" end + add_index "organisations", ["code"], :name => "index_organisations_on_code", :unique => true + create_table "pt_links", force: true do |t| t.integer "start_of_link_id", limit: 8 t.integer "end_of_link_id", limit: 8 |
