@spfn/auth 0.2.0-beta.71 → 0.2.0-beta.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,32 @@
1
+ -- Corrective migration: drop leftover bigserial sequence defaults on FK columns.
2
+ --
3
+ -- These columns were originally declared `bigserial` in 0000 and converted to
4
+ -- `bigint` in 0002. Postgres `ALTER COLUMN ... SET DATA TYPE bigint` does NOT drop
5
+ -- the serial-created `DEFAULT nextval(...)`, so every DB that ran those migrations
6
+ -- still has a dangling sequence default on each FK column. That default is wrong:
7
+ -- an FK with no explicit value would silently receive a sequence number instead of
8
+ -- pointing at a real parent row. The entities define these columns with no default
9
+ -- (foreignKey() -> bigint, not null, no default) and all writers set them explicitly,
10
+ -- so the live DB is simply diverged. Drizzle cannot detect this — its snapshot already
11
+ -- shows bigint/no-default — so this corrective migration is written by hand.
12
+
13
+ ALTER TABLE "spfn_auth"."users" ALTER COLUMN "role_id" DROP DEFAULT;--> statement-breakpoint
14
+ ALTER TABLE "spfn_auth"."user_profiles" ALTER COLUMN "user_id" DROP DEFAULT;--> statement-breakpoint
15
+ ALTER TABLE "spfn_auth"."user_public_keys" ALTER COLUMN "user_id" DROP DEFAULT;--> statement-breakpoint
16
+ ALTER TABLE "spfn_auth"."user_social_accounts" ALTER COLUMN "user_id" DROP DEFAULT;--> statement-breakpoint
17
+ ALTER TABLE "spfn_auth"."user_invitations" ALTER COLUMN "role_id" DROP DEFAULT;--> statement-breakpoint
18
+ ALTER TABLE "spfn_auth"."user_invitations" ALTER COLUMN "invited_by_id" DROP DEFAULT;--> statement-breakpoint
19
+ ALTER TABLE "spfn_auth"."role_permissions" ALTER COLUMN "role_id" DROP DEFAULT;--> statement-breakpoint
20
+ ALTER TABLE "spfn_auth"."role_permissions" ALTER COLUMN "permission_id" DROP DEFAULT;--> statement-breakpoint
21
+ ALTER TABLE "spfn_auth"."user_permissions" ALTER COLUMN "user_id" DROP DEFAULT;--> statement-breakpoint
22
+ ALTER TABLE "spfn_auth"."user_permissions" ALTER COLUMN "permission_id" DROP DEFAULT;--> statement-breakpoint
23
+ DROP SEQUENCE IF EXISTS "spfn_auth"."users_role_id_seq";--> statement-breakpoint
24
+ DROP SEQUENCE IF EXISTS "spfn_auth"."user_profiles_user_id_seq";--> statement-breakpoint
25
+ DROP SEQUENCE IF EXISTS "spfn_auth"."user_public_keys_user_id_seq";--> statement-breakpoint
26
+ DROP SEQUENCE IF EXISTS "spfn_auth"."user_social_accounts_user_id_seq";--> statement-breakpoint
27
+ DROP SEQUENCE IF EXISTS "spfn_auth"."user_invitations_role_id_seq";--> statement-breakpoint
28
+ DROP SEQUENCE IF EXISTS "spfn_auth"."user_invitations_invited_by_id_seq";--> statement-breakpoint
29
+ DROP SEQUENCE IF EXISTS "spfn_auth"."role_permissions_role_id_seq";--> statement-breakpoint
30
+ DROP SEQUENCE IF EXISTS "spfn_auth"."role_permissions_permission_id_seq";--> statement-breakpoint
31
+ DROP SEQUENCE IF EXISTS "spfn_auth"."user_permissions_user_id_seq";--> statement-breakpoint
32
+ DROP SEQUENCE IF EXISTS "spfn_auth"."user_permissions_permission_id_seq";