summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-11-07 14:54:45 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2017-11-07 14:54:45 +0100
commit46bc6b5d8fd934823a28a358cb57b8e098352499 (patch)
tree57033bd2e1ef97099ae01521a8b38c9876e9e58b /db/migrate
parent3cb4614273bfc10a6d3acc98d7a450dbe9f1aaaf (diff)
parent760a154a032319a90e15dcf4d54ec1c1cdde9e1c (diff)
downloadgitlab-ce-46bc6b5d8fd934823a28a358cb57b8e098352499.tar.gz
Merge branch '38464-k8s-apps' into add-ingress-to-cluster-applications
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20170918111708_create_project_custom_attributes.rb15
-rw-r--r--db/migrate/20170918140927_create_group_custom_attributes.rb19
2 files changed, 34 insertions, 0 deletions
diff --git a/db/migrate/20170918111708_create_project_custom_attributes.rb b/db/migrate/20170918111708_create_project_custom_attributes.rb
new file mode 100644
index 00000000000..b5bc90ec02e
--- /dev/null
+++ b/db/migrate/20170918111708_create_project_custom_attributes.rb
@@ -0,0 +1,15 @@
+class CreateProjectCustomAttributes < ActiveRecord::Migration
+ DOWNTIME = false
+
+ def change
+ create_table :project_custom_attributes do |t|
+ t.timestamps_with_timezone null: false
+ t.references :project, null: false, foreign_key: { on_delete: :cascade }
+ t.string :key, null: false
+ t.string :value, null: false
+
+ t.index [:project_id, :key], unique: true
+ t.index [:key, :value]
+ end
+ end
+end
diff --git a/db/migrate/20170918140927_create_group_custom_attributes.rb b/db/migrate/20170918140927_create_group_custom_attributes.rb
new file mode 100644
index 00000000000..3879ea15eb6
--- /dev/null
+++ b/db/migrate/20170918140927_create_group_custom_attributes.rb
@@ -0,0 +1,19 @@
+class CreateGroupCustomAttributes < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def change
+ create_table :group_custom_attributes do |t|
+ t.timestamps_with_timezone null: false
+ t.references :group, null: false
+ t.string :key, null: false
+ t.string :value, null: false
+
+ t.index [:group_id, :key], unique: true
+ t.index [:key, :value]
+ end
+
+ add_foreign_key :group_custom_attributes, :namespaces, column: :group_id, on_delete: :cascade # rubocop: disable Migration/AddConcurrentForeignKey
+ end
+end