summaryrefslogtreecommitdiff
path: root/db/migrate/20210729081739_create_project_topics.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20210729081739_create_project_topics.rb')
-rw-r--r--db/migrate/20210729081739_create_project_topics.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20210729081739_create_project_topics.rb b/db/migrate/20210729081739_create_project_topics.rb
new file mode 100644
index 00000000000..cbb8842f653
--- /dev/null
+++ b/db/migrate/20210729081739_create_project_topics.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class CreateProjectTopics < ActiveRecord::Migration[6.1]
+ def change
+ create_table :project_topics do |t|
+ t.bigint :project_id, null: false
+ t.bigint :topic_id, null: false
+
+ t.index :project_id
+ t.index :topic_id
+ t.index [:project_id, :topic_id], unique: true
+
+ t.timestamps_with_timezone
+ end
+ end
+end