1 Commits

Author SHA1 Message Date
af20a4aa57 fix(lifecycle): status_changed_by uuid → text (Süper Panel founderId nanoid)
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled
Süper Panel suspend/ban aksiyonları founderId olarak panelin Better Auth
kullanıcı ID'sini (32 karakterlik nanoid) gönderiyor. users.status_changed_by
uuid tipinde olduğu için Postgres 'invalid input syntax for type uuid' ile
düşüyor ve kullanıcı askıya alınamıyordu. Alan FK'sız salt audit alanı;
text'e genişletildi, mevcut UUID değerleri korunuyor.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 12:34:24 +03:00
3 changed files with 16 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
-- Süper Panel lifecycle aksiyonları founderId olarak panelin Better Auth
-- kullanıcı ID'sini (32 karakter nanoid) gönderiyor; uuid kolonu bunu
-- reddedip suspend/ban'ı 500 ile düşürüyordu ("invalid input syntax for
-- type uuid"). Alan FK'sız salt audit → text. Mevcut UUID değerleri
-- USING ile aynen korunur.
ALTER TABLE "users" ALTER COLUMN "status_changed_by" TYPE text USING "status_changed_by"::text;

View File

@@ -246,6 +246,13 @@
"when": 1784965129879, "when": 1784965129879,
"tag": "0034_vehicle_fully_fetched", "tag": "0034_vehicle_fully_fetched",
"breakpoints": true "breakpoints": true
},
{
"idx": 35,
"version": "7",
"when": 1786440823041,
"tag": "0035_status_changed_by_text",
"breakpoints": true
} }
] ]
} }

View File

@@ -32,7 +32,9 @@ export const users = pgTable(
status: varchar("status", { length: 20 }).default("active").notNull(), status: varchar("status", { length: 20 }).default("active").notNull(),
statusReason: text("status_reason"), statusReason: text("status_reason"),
statusChangedAt: timestamp("status_changed_at", { withTimezone: true }), statusChangedAt: timestamp("status_changed_at", { withTimezone: true }),
statusChangedBy: uuid("status_changed_by"), // Süper Panel founder ID'si (Better Auth nanoid) — sase users.id UUID'si
// DEĞİL, o yüzden text. FK yok; salt audit alanı.
statusChangedBy: text("status_changed_by"),
referralCode: varchar("referral_code", { length: 20 }), referralCode: varchar("referral_code", { length: 20 }),
referredBy: uuid("referred_by"), referredBy: uuid("referred_by"),
// Reward days earned via referrals that couldn't be applied to a live // Reward days earned via referrals that couldn't be applied to a live