tabletop-companion/db/migrate/20240529122012_create_table...

18 lines
517 B
Ruby

# frozen_string_literal: true
class CreateTableInvites < ActiveRecord::Migration[7.1]
def change
create_table :table_invites do |t|
t.belongs_to :table, null: false, foreign_key: true
t.string :email, null: false
t.datetime :accepted_at
t.datetime :declined_at
t.timestamps
end
add_check_constraint :table_invites, "length(email) >= 5", name: "chk_email_min_length"
add_check_constraint :table_invites, "length(email) <= 100", name: "chk_email_max_length"
end
end