Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20200416120128_add_columns_to_terraform_state.rb')
-rw-r--r--db/migrate/20200416120128_add_columns_to_terraform_state.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20200416120128_add_columns_to_terraform_state.rb b/db/migrate/20200416120128_add_columns_to_terraform_state.rb
new file mode 100644
index 00000000000..e657b1fde3f
--- /dev/null
+++ b/db/migrate/20200416120128_add_columns_to_terraform_state.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddColumnsToTerraformState < ActiveRecord::Migration[6.0]
+ DOWNTIME = false
+
+ def change
+ add_column :terraform_states, :lock_xid, :string, limit: 255
+ add_column :terraform_states, :locked_at, :datetime_with_timezone
+ add_column :terraform_states, :locked_by_user_id, :bigint
+ add_column :terraform_states, :uuid, :string, limit: 32, null: false # rubocop:disable Rails/NotNullColumn (table not used yet)
+ add_column :terraform_states, :name, :string, limit: 255
+ add_index :terraform_states, :locked_by_user_id # rubocop:disable Migration/AddIndex (table not used yet)
+ add_index :terraform_states, :uuid, unique: true # rubocop:disable Migration/AddIndex (table not used yet)
+ add_index :terraform_states, [:project_id, :name], unique: true # rubocop:disable Migration/AddIndex (table not used yet)
+ remove_index :terraform_states, :project_id # rubocop:disable Migration/RemoveIndex (table not used yet)
+ end
+end