PhoenixKit.Migrations.Postgres.V100 (phoenix_kit v1.7.112)

Copy Markdown View Source

V100: Staff module tables.

Creates four tables used by phoenix_kit_staff:

  • phoenix_kit_staff_departments — top-level org units
  • phoenix_kit_staff_teams — teams inside a department
  • phoenix_kit_staff_people — staff profiles, each linked 1:1 to a phoenix_kit_users row (required FK)
  • phoenix_kit_staff_team_memberships — join table for team membership

UUIDv7 primary keys, timestamptz timestamps, cascading deletes department → team → team_memberships; person deletion cascades to team_memberships; user deletion cascades to the staff person profile.

Departments and teams are identified by UUID only — no slug columns. A team's name must be unique within its department.

Summary

Functions

Drops all four staff tables.

Functions

down(opts)

Drops all four staff tables.

Lossy rollback: all staff data (departments, teams, people, and their team memberships) is permanently destroyed. Back up before rolling back in production.

up(opts)