Create project_aliases table

This commit is contained in:
Patrick Bajao 2019-06-13 15:37:35 +08:00
parent 39b9cfa0bf
commit 13ab6a3842
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,16 @@
# frozen_string_literal: true
class CreateProjectAliases < ActiveRecord::Migration[5.1]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
create_table :project_aliases do |t|
t.references :project, null: false, index: true, foreign_key: { on_delete: :cascade }, type: :integer
t.string :name, null: false, index: { unique: true }
t.timestamps_with_timezone null: false
end
end
end

View file

@ -2401,6 +2401,15 @@ ActiveRecord::Schema.define(version: 20190620112608) do
t.string "encrypted_token_iv", null: false
end
create_table "project_aliases", force: :cascade do |t|
t.integer "project_id", null: false
t.string "name", null: false
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
t.index ["name"], name: "index_project_aliases_on_name", unique: true, using: :btree
t.index ["project_id"], name: "index_project_aliases_on_project_id", using: :btree
end
create_table "project_authorizations", id: false, force: :cascade do |t|
t.integer "user_id", null: false
t.integer "project_id", null: false
@ -3780,6 +3789,7 @@ ActiveRecord::Schema.define(version: 20190620112608) do
add_foreign_key "pool_repositories", "projects", column: "source_project_id", on_delete: :nullify
add_foreign_key "pool_repositories", "shards", on_delete: :restrict
add_foreign_key "project_alerting_settings", "projects", on_delete: :cascade
add_foreign_key "project_aliases", "projects", on_delete: :cascade
add_foreign_key "project_authorizations", "projects", on_delete: :cascade
add_foreign_key "project_authorizations", "users", on_delete: :cascade
add_foreign_key "project_auto_devops", "projects", on_delete: :cascade