summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2019-01-02 19:56:03 +0900
committerShinya Maeda <shinya@gitlab.com>2019-01-04 22:17:03 +0900
commitdf7ed9eef2048c9a2f79860e00a69f84fa92e10e (patch)
tree58af696ab41bf8a9649f4c60b7663ec11bd496ec /db
parent8a14548fc741e8d115d99e8303e36ed83660494d (diff)
downloadgitlab-ce-df7ed9eef2048c9a2f79860e00a69f84fa92e10e.tar.gz
Add unique constraint to release and url
Fix coding style Improve coding style Decouple UPDATE and DELETE operations of asset links Rename links_attributes to assets:links Rename exposed param and updated spec
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20181228175414_create_releases_link_table.rb1
-rw-r--r--db/schema.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/db/migrate/20181228175414_create_releases_link_table.rb b/db/migrate/20181228175414_create_releases_link_table.rb
index bf1e50dd36e..a8eb9db8461 100644
--- a/db/migrate/20181228175414_create_releases_link_table.rb
+++ b/db/migrate/20181228175414_create_releases_link_table.rb
@@ -12,6 +12,7 @@ class CreateReleasesLinkTable < ActiveRecord::Migration[5.0]
t.string :name, null: false
t.timestamps_with_timezone null: false
+ t.index [:release_id, :url], unique: true
t.index [:release_id, :name], unique: true
end
end
diff --git a/db/schema.rb b/db/schema.rb
index 55b9a6aaf99..c9605e69b33 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1805,6 +1805,7 @@ ActiveRecord::Schema.define(version: 20190103140724) do
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
t.index ["release_id", "name"], name: "index_release_links_on_release_id_and_name", unique: true, using: :btree
+ t.index ["release_id", "url"], name: "index_release_links_on_release_id_and_url", unique: true, using: :btree
end
create_table "releases", force: :cascade do |t|