diff options
-rw-r--r-- | db/migrate/20190613073003_create_project_aliases.rb | 16 | ||||
-rw-r--r-- | db/schema.rb | 10 |
2 files changed, 26 insertions, 0 deletions
diff --git a/db/migrate/20190613073003_create_project_aliases.rb b/db/migrate/20190613073003_create_project_aliases.rb new file mode 100644 index 00000000000..5a2c2ba0cf2 --- /dev/null +++ b/db/migrate/20190613073003_create_project_aliases.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index a94e5142627..16a9f3e9c2e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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 |