fix(internal-admin): founderId uuid → text (status_changed_by, impersonated_by) #257

Open
root wants to merge 1 commits from fix/lifecycle-founder-uuid into main
Owner

Ne

Panelden "Kullanıcıyı askıya al" (ve ban / reactivate / readonly impersonation) 500 dönüyordu:

invalid input syntax for type uuid: "d17M1M3S6cMhGiTnYRw9ZwBQNtj8Koxs"

Panel founderId olarak Better Auth kullanıcı ID'sini (32 karakter nanoid) gönderiyor; users.status_changed_by ve sessions.impersonated_by kolonları uuid. İkisi de FK'sız salt audit alanı → text.

Prod'da sessions.impersonated_by bugüne kadar hiç dolmamış (0 satır), yani readonly impersonation da aynı sebeple hiç çalışmamış.

Değişiklik

  • Migration 0038_founder_id_text.sql: iki kolon ALTER TYPE text USING ...::text (mevcut 1 UUID değeri korunur). start.sh migrate'i boot'ta çalıştırıyor, ek adım yok.
  • schema/core.ts: iki alan text(...).
  • Eski dal (#257, migration 0035) main'deki 0035_subscription_dunning ile çakışıyordu; rebase edilip 0038 olarak yeniden numaralandı.

Test

  • biome check temiz. tsc --noEmit main'deki mevcut corgi.service.ts:40 hatası dışında temiz (bu PR'dan bağımsız).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ww3tfpuxBcettz81dDvyYt

## Ne Panelden **"Kullanıcıyı askıya al"** (ve ban / reactivate / readonly impersonation) 500 dönüyordu: ``` invalid input syntax for type uuid: "d17M1M3S6cMhGiTnYRw9ZwBQNtj8Koxs" ``` Panel `founderId` olarak Better Auth kullanıcı ID'sini (32 karakter nanoid) gönderiyor; `users.status_changed_by` ve `sessions.impersonated_by` kolonları `uuid`. İkisi de FK'sız salt audit alanı → `text`. Prod'da `sessions.impersonated_by` bugüne kadar hiç dolmamış (0 satır), yani readonly impersonation da aynı sebeple hiç çalışmamış. ## Değişiklik - Migration `0038_founder_id_text.sql`: iki kolon `ALTER TYPE text USING ...::text` (mevcut 1 UUID değeri korunur). `start.sh` migrate'i boot'ta çalıştırıyor, ek adım yok. - `schema/core.ts`: iki alan `text(...)`. - Eski dal (#257, migration 0035) main'deki `0035_subscription_dunning` ile çakışıyordu; rebase edilip 0038 olarak yeniden numaralandı. ## Test - `biome check` temiz. `tsc --noEmit` main'deki mevcut `corgi.service.ts:40` hatası dışında temiz (bu PR'dan bağımsız). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Ww3tfpuxBcettz81dDvyYt
root added 1 commit 2026-08-11 12:34:44 +03:00
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
af20a4aa57
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>
root changed title from fix(lifecycle): status_changed_by uuid → text (Süper Panel founderId nanoid) to fix(internal-admin): founderId uuid → text (status_changed_by, impersonated_by) 2026-09-26 12:41:44 +03:00
root force-pushed fix/lifecycle-founder-uuid from af20a4aa57 to 462da4b2c1 2026-09-26 12:41:46 +03:00 Compare
Some checks are pending
QA Gate (P0/P1) / Test affected app (pull_request) Waiting to run
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/lifecycle-founder-uuid:fix/lifecycle-founder-uuid
git checkout fix/lifecycle-founder-uuid
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: root/sase.tr#257