Commit 53964aca authored by Toon Claes's avatar Toon Claes

A project can have only one project_repository

parent be778257
......@@ -12,7 +12,7 @@ class CreateProjectRepositories < ActiveRecord::Migration[5.0]
create_table :project_repositories, id: :bigserial do |t|
t.references :shard, null: false, index: true, foreign_key: { on_delete: :restrict }
t.string :disk_path, null: false, index: { unique: true }
t.references :project, null: false, index: true, foreign_key: { on_delete: :cascade }
t.references :project, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade }
end
end
end
......@@ -2154,7 +2154,7 @@ ActiveRecord::Schema.define(version: 20181126153547) do
t.string "disk_path", null: false
t.integer "project_id", null: false
t.index ["disk_path"], name: "index_project_repositories_on_disk_path", unique: true, using: :btree
t.index ["project_id"], name: "index_project_repositories_on_project_id", using: :btree
t.index ["project_id"], name: "index_project_repositories_on_project_id", unique: true, using: :btree
t.index ["shard_id"], name: "index_project_repositories_on_shard_id", using: :btree
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment