summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20191031095636_create_project_settings.rb12
-rw-r--r--db/migrate/20200207151640_create_deployment_clusters.rb16
2 files changed, 28 insertions, 0 deletions
diff --git a/db/migrate/20191031095636_create_project_settings.rb b/db/migrate/20191031095636_create_project_settings.rb
new file mode 100644
index 00000000000..0263eceb3c1
--- /dev/null
+++ b/db/migrate/20191031095636_create_project_settings.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class CreateProjectSettings < ActiveRecord::Migration[5.2]
+ DOWNTIME = false
+
+ def change
+ create_table :project_settings, id: false do |t|
+ t.timestamps_with_timezone null: false
+ t.references :project, primary_key: true, default: nil, type: :integer, index: false, foreign_key: { on_delete: :cascade }
+ end
+ end
+end
diff --git a/db/migrate/20200207151640_create_deployment_clusters.rb b/db/migrate/20200207151640_create_deployment_clusters.rb
new file mode 100644
index 00000000000..233e91d31b0
--- /dev/null
+++ b/db/migrate/20200207151640_create_deployment_clusters.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class CreateDeploymentClusters < ActiveRecord::Migration[6.0]
+ DOWNTIME = false
+
+ def change
+ create_table :deployment_clusters, id: false, force: :cascade do |t|
+ t.references :deployment, foreign_key: { on_delete: :cascade }, primary_key: true, type: :integer, index: false, default: nil
+ t.references :cluster, foreign_key: { on_delete: :cascade }, type: :integer, index: false, null: false
+ t.string :kubernetes_namespace, limit: 255
+
+ t.index [:cluster_id, :kubernetes_namespace], name: 'idx_deployment_clusters_on_cluster_id_and_kubernetes_namespace'
+ t.index [:cluster_id, :deployment_id], unique: true
+ end
+ end
+end