summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorAndreas Brandl <abrandl@gitlab.com>2019-07-26 07:42:56 +0000
committerAndreas Brandl <abrandl@gitlab.com>2019-07-26 07:42:56 +0000
commit861959cae3f2c295b4b266bfc68652db86905c3e (patch)
treec6ce27bd663af55a5a321a7f0af1216530bc7471 /db
parent28f2225bdfee4d353f07a766c6c8b29ba6181397 (diff)
parent3f9aa7dae25ad7f208b485dd7d3fa42905069385 (diff)
downloadgitlab-ce-861959cae3f2c295b4b266bfc68652db86905c3e.tar.gz
Merge branch 'delete-designs-v2' into 'master'
Adds event enum column to DesignsVersions join table See merge request gitlab-org/gitlab-ce!30745
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190715140740_add_event_type_to_design_management_designs_versions.rb27
-rw-r--r--db/schema.rb2
2 files changed, 29 insertions, 0 deletions
diff --git a/db/migrate/20190715140740_add_event_type_to_design_management_designs_versions.rb b/db/migrate/20190715140740_add_event_type_to_design_management_designs_versions.rb
new file mode 100644
index 00000000000..81a8b0a3271
--- /dev/null
+++ b/db/migrate/20190715140740_add_event_type_to_design_management_designs_versions.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+# This migration sets up a event enum on the DesignsVersions join table
+class AddEventTypeToDesignManagementDesignsVersions < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ # We disable these cops here because adding this column is safe. The table does not
+ # have any data in it.
+ # rubocop: disable Migration/AddIndex
+ # rubocop: disable Migration/AddColumn
+ def up
+ add_column(:design_management_designs_versions, :event, :integer,
+ limit: 2,
+ null: false,
+ default: 0)
+ add_index(:design_management_designs_versions, :event)
+ end
+
+ # rubocop: disable Migration/RemoveIndex
+ def down
+ remove_index(:design_management_designs_versions, :event)
+ remove_column(:design_management_designs_versions, :event)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index dbfc5959d9d..67479937b47 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1097,8 +1097,10 @@ ActiveRecord::Schema.define(version: 2019_07_25_012225) do
create_table "design_management_designs_versions", id: false, force: :cascade do |t|
t.bigint "design_id", null: false
t.bigint "version_id", null: false
+ t.integer "event", limit: 2, default: 0, null: false
t.index ["design_id", "version_id"], name: "design_management_designs_versions_uniqueness", unique: true
t.index ["design_id"], name: "index_design_management_designs_versions_on_design_id"
+ t.index ["event"], name: "index_design_management_designs_versions_on_event"
t.index ["version_id"], name: "index_design_management_designs_versions_on_version_id"
end