managarten/services/mana-auth/sql
Till JS 89388fb369 refactor(mana-auth): move enums from public to auth schema
pgEnum() defaults to the public schema. Because
drizzle.config.ts sets schemaFilter: ['auth'], push introspection
never saw the enums and kept re-emitting CREATE TYPE access_tier ...,
failing with 42710. This blocked setup-databases.sh from advancing
mana-auth past the enum declarations and silently masked other drift
(e.g. the new `kind` column on auth.users going un-pushed).

Source side: three enums now live on authSchema via
authSchema.enum(...) instead of pgEnum(...). DB side: migration 006
recreates access_tier / user_role / user_kind inside the auth schema,
repoints auth.users.access_tier and auth.users.role via ::text cast
(preserving all data and defaults), and drops the old public types.

After this, `drizzle-kit push --force` reports "No changes detected"
on a clean DB and the broader `pnpm setup:db` run is green without
workarounds.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 15:36:39 +02:00
..
001_add_access_tier.sql fix(inventar): import FeedbackPage from @manacore/feedback, not shared-ui 2026-03-30 21:56:19 +02:00
002_encryption_vaults.sql feat(mana-auth): encryption vault — phase 2 (server-side master key custody) 2026-04-07 18:38:09 +02:00
003_recovery_wrap.sql feat(mana-auth): phase 9 milestone 2 — vault recovery wrap + zero-knowledge 2026-04-07 22:05:49 +02:00
004_spaces.sql feat(spaces): add spaces pg schema — credentials + module_permissions 2026-04-20 16:13:33 +02:00
005_personas.sql chore(mana-auth): add 005 persona tables migration 2026-04-23 15:36:26 +02:00
006_enums_to_auth_schema.sql refactor(mana-auth): move enums from public to auth schema 2026-04-23 15:36:39 +02:00