class CreateAttachments < ActiveRecord::Migration[7.1] def change create_table :attachments do |t| t.references 'asset' t.integer "attachable_for_id" t.text "attachable_for_type" t.jsonb "body", default: {} t.jsonb "url", default: {} t.jsonb "props", default: {} t.boolean "is_favorite", default: false, null: false t.integer "position" t.timestamps t.index ["attachable_for_id", "attachable_for_type"], name: "attachable_for" t.index ["is_favorite"], name: "index_attachments_on_is_favorite" end end end