Add Democratic fundraising platform.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
root
2026-05-16 00:47:44 +00:00
parent 89f9b8dc83
commit 391d90a754
141 changed files with 14989 additions and 914 deletions

View File

@@ -0,0 +1,26 @@
-- Add optional username column, backfill, then constrain.
ALTER TABLE "User" ADD COLUMN "username" TEXT;
UPDATE "User"
SET "username" =
LEFT(
COALESCE(
NULLIF(
regexp_replace(
lower(trim(split_part("email", '@', 1))),
'[^a-z0-9_]',
'_',
'g'
),
''
),
'supporter'
),
23
)
|| '_'
|| right(replace("id", '-', ''), 8);
ALTER TABLE "User" ALTER COLUMN "username" SET NOT NULL;
CREATE UNIQUE INDEX "User_username_key" ON "User" ("username");