sorarebuddy/db/migrations/00006_rename_club_membership.sql
2024-05-23 08:18:54 +04:00

12 lines
403 B
SQL

-- +goose Up
ALTER TABLE club_memberships RENAME TO memberships;
ALTER TABLE memberships RENAME COLUMN club_slug TO team_slug;
ALTER TABLE memberships ADD COLUMN membership_type TEXT NOT NULL DEFAULT 'club';
-- +goose Down
ALTER TABLE memberships RENAME TO club_memberships;
ALTER TABLE club_memberships RENAME COLUMN team_slug TO club_slug;
ALTER TABLE club_memberships DROP COLUMN membership_type;