wedding-planner/db/migrate/20250127183547_create_invitations.rb
Manuel Bustillo a5d3062654
Some checks failed
Run unit tests / rubocop (pull_request) Successful in 48s
Run unit tests / check-licenses (pull_request) Successful in 55s
Run unit tests / copyright_notice (pull_request) Successful in 1m16s
Run unit tests / unit_tests (pull_request) Failing after 3m39s
Run unit tests / build-static-assets (pull_request) Has been skipped
Define and seed an invitation model
2025-01-27 20:08:28 +01:00

11 lines
317 B
Ruby

class CreateInvitations < ActiveRecord::Migration[8.0]
def change
create_table :invitations, id: :uuid do |t|
t.references :wedding, null: false, foreign_key: { on_delete: :cascade }, type: :uuid
t.timestamps
end
add_reference :guests, :invitation, foreign_key: true, type: :uuid
end
end