summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2019-06-28 10:55:10 +0000
committerBob Van Landuyt <bob@gitlab.com>2019-06-28 10:55:10 +0000
commite17edd37ab3a33d874d6ad7af92f0f5045d970c7 (patch)
tree3665d4846b9aa27bc12e22f9c50db72845187554 /db
parent5ee5b280b05f63768f359d0b82d5edd490c0e7cd (diff)
parent2b4d755df14871a3b77bbfc219d6dd350dbc7667 (diff)
downloadgitlab-ce-e17edd37ab3a33d874d6ad7af92f0f5045d970c7.tar.gz
Merge branch '3264-project-aliases-ce' into 'master'
CE port of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14108 See merge request gitlab-org/gitlab-ce!29604
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190613073003_create_project_aliases.rb16
-rw-r--r--db/schema.rb10
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 054dbc7201f..87a935ee08e 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -2412,6 +2412,15 @@ ActiveRecord::Schema.define(version: 20190625184066) 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
@@ -3793,6 +3802,7 @@ ActiveRecord::Schema.define(version: 20190625184066) 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