summaryrefslogtreecommitdiff
path: root/db/migrate/20170301101006_add_ci_runner_namespaces.rb
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-05-02 17:43:20 +0200
committerDylan Griffith <dyl.griffith@gmail.com>2018-05-02 17:43:20 +0200
commit0970e7b9608d6ada1c0fe45242ea092ea91068aa (patch)
tree79b16801413032e669f8369ee111561f152ff923 /db/migrate/20170301101006_add_ci_runner_namespaces.rb
parent2261188f48dff25c5bfbbca739c5f570849155f4 (diff)
downloadgitlab-ce-0970e7b9608d6ada1c0fe45242ea092ea91068aa.tar.gz
Rename RunnerGroup -> RunnerNamespace
Diffstat (limited to 'db/migrate/20170301101006_add_ci_runner_namespaces.rb')
-rw-r--r--db/migrate/20170301101006_add_ci_runner_namespaces.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20170301101006_add_ci_runner_namespaces.rb b/db/migrate/20170301101006_add_ci_runner_namespaces.rb
new file mode 100644
index 00000000000..7e7df2f4d22
--- /dev/null
+++ b/db/migrate/20170301101006_add_ci_runner_namespaces.rb
@@ -0,0 +1,19 @@
+class AddCiRunnerNamespaces < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def change
+ create_table :ci_runner_namespaces do |t|
+ t.integer :runner_id
+ t.integer :namespace_id
+
+ t.index [:runner_id, :namespace_id], unique: true
+ t.index :namespace_id
+ t.foreign_key :ci_runners, column: :runner_id, on_delete: :cascade
+ t.foreign_key :namespaces, column: :namespace_id, on_delete: :cascade
+ end
+ end
+end