diff options
-rw-r--r-- | db/migrate/20170828093725_create_project_auto_dev_ops.rb | 11 | ||||
-rw-r--r-- | db/schema.rb | 6 |
2 files changed, 6 insertions, 11 deletions
diff --git a/db/migrate/20170828093725_create_project_auto_dev_ops.rb b/db/migrate/20170828093725_create_project_auto_dev_ops.rb index 00bf29f874c..c1bb4f20c1d 100644 --- a/db/migrate/20170828093725_create_project_auto_dev_ops.rb +++ b/db/migrate/20170828093725_create_project_auto_dev_ops.rb @@ -3,19 +3,14 @@ class CreateProjectAutoDevOps < ActiveRecord::Migration DOWNTIME = false - disable_ddl_transaction! - def up create_table :project_auto_devops do |t| - t.belongs_to :project, null: false, index: { unique: true } + t.belongs_to :project, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade } + t.datetime_with_timezone :created_at, null: false + t.datetime_with_timezone :updated_at, null: false t.boolean :enabled, default: nil, null: true t.string :domain end - - add_timestamps_with_timezone(:project_auto_devops, null: false) - - # No need to check for violations as its a new table - add_concurrent_foreign_key(:project_auto_devops, :projects, column: :project_id) end def down diff --git a/db/schema.rb b/db/schema.rb index 73e4993e422..71417f586aa 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1130,10 +1130,10 @@ ActiveRecord::Schema.define(version: 20170905112933) do create_table "project_auto_devops", force: :cascade do |t| t.integer "project_id", null: false - t.boolean "enabled" - t.string "domain" t.datetime_with_timezone "created_at", null: false t.datetime_with_timezone "updated_at", null: false + t.boolean "enabled" + t.string "domain" end add_index "project_auto_devops", ["project_id"], name: "index_project_auto_devops_on_project_id", unique: true, using: :btree @@ -1755,7 +1755,7 @@ ActiveRecord::Schema.define(version: 20170905112933) do add_foreign_key "personal_access_tokens", "users" 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", name: "fk_45436b12b2", on_delete: :cascade + add_foreign_key "project_auto_devops", "projects", on_delete: :cascade add_foreign_key "project_features", "projects", name: "fk_18513d9b92", on_delete: :cascade add_foreign_key "project_group_links", "projects", name: "fk_daa8cee94c", on_delete: :cascade add_foreign_key "project_import_data", "projects", name: "fk_ffb9ee3a10", on_delete: :cascade |