null: false, foreign_key: { on_delete: :cascade } t.string :name, null: false, limit: 20, index: { unique: true } t.string :uri, null: false, limit: 20, index: { unique: true } t.text :description t.timestamps end create_table :advent_calendar_registrations do t.references :advent_calendar, null: false, foreign_key: { on_delete: :cascade } t.integer :day, null: false t.string :comment, null: false, default: "", limit: 100 t.string :url, null: false, default: "", limit: 100 t.timestamps t.index [:advent_calendar_id, :day], unique: true end 54