about summary refs log tree commit diff
path: root/db/migrate/20220824233535_create_status_trends.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20220824233535_create_status_trends.rb')
-rw-r--r--db/migrate/20220824233535_create_status_trends.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20220824233535_create_status_trends.rb b/db/migrate/20220824233535_create_status_trends.rb
new file mode 100644
index 000000000..cea0abf35
--- /dev/null
+++ b/db/migrate/20220824233535_create_status_trends.rb
@@ -0,0 +1,12 @@
+class CreateStatusTrends < ActiveRecord::Migration[6.1]
+  def change
+    create_table :status_trends do |t|
+      t.references :status, null: false, foreign_key: { on_delete: :cascade }, index: { unique: true }
+      t.references :account, null: false, foreign_key: { on_delete: :cascade }
+      t.float :score, null: false, default: 0
+      t.integer :rank, null: false, default: 0
+      t.boolean :allowed, null: false, default: false
+      t.string :language
+    end
+  end
+end