Files
btrc-hub/backend/db/migrate/20250227211400_create_posts.rb
2025-02-27 23:38:45 +09:00

13 lines
415 B
Ruby

class CreatePosts < ActiveRecord::Migration[7.0]
def change
create_table :posts do |t|
t.string :url, limit: 2000, null: false
t.string :thumbnail, limit: 255, null: false
t.string :thumbnail_base, limit: 2000, null: false
t.references :parent, foreign_key: { to_table: :posts }
t.references :uploaded_user, foreign_key: { to_table: :users }
t.timestamps
end
end
end