add new user (#18)

This commit is contained in:
Bill Yang 2025-02-19 21:00:55 -05:00 committed by GitHub
parent 8ada9b8c16
commit 61d64c1293
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 586 additions and 42 deletions

View file

@ -21,11 +21,13 @@ export async function initializePostgres() {
CREATE TABLE IF NOT EXISTS "user" (
"id" text not null primary key,
"name" text not null,
"username" text not null unique,
"email" text not null unique,
"emailVerified" boolean not null,
"image" text,
"createdAt" timestamp not null,
"updatedAt" timestamp not null
"updatedAt" timestamp not null,
"role" text not null default 'user'
);
`,
@ -120,6 +122,8 @@ export async function initializePostgres() {
});
}
await sql`UPDATE "user" SET "role" = 'admin' WHERE username = 'admin'`;
console.log("Tables created successfully.");
} catch (err) {
console.error("Error creating tables:", err);