mirror of
https://github.com/rybbit-io/rybbit.git
synced 2025-05-12 12:55:36 +02:00
add new user (#18)
This commit is contained in:
parent
8ada9b8c16
commit
61d64c1293
17 changed files with 586 additions and 42 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue