Skip to content

Commit

Permalink
fixing seed script
Browse files Browse the repository at this point in the history
  • Loading branch information
webdevcody committed Jul 8, 2024
1 parent 77480e1 commit 32409e7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: "3.9"
services:
group-finder-db:
wdc-saas-starter-kit:
image: postgres
restart: always
container_name: group-finder-db
container_name: wdc-saas-starter-kit
ports:
- 5432:5432
environment:
Expand Down
28 changes: 24 additions & 4 deletions src/db/seed.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
import "dotenv/config";

import { database, pg } from "./index";
import { groups, users } from "@/db/schema";
import { accounts, groups, profiles, users } from "@/db/schema";

async function main() {
const [user] = await database
.insert(users)
.values({
name: "Rick James",
email: "[email protected]",
emailVerified: undefined,
image: undefined,
id: "616d6471-e7c8-44f5-866b-0126b0d467c2",
})
.onConflictDoNothing()
.returning();

const [account] = await database
.insert(accounts)
.values({
accountType: "email",
githubId: undefined,
googleId: undefined,
password:
"39a491e82a8c8b7d85294ce9dde7d91c62895c87e78b289dabb2e55ae5e317ee9285738a2ff5deac5de0c8182592674b28f96882527cb6d90f988fef2b96d9c2",
salt: "bAxwTKjE6LjYiH/tyYPin7bTGd+Gp2AlaWSJ10W6VDnDXuBeQLQYMHkxRPzuYQ7zfN9EjRE0aFxe5ECoI0TpWAeRWeoxaa/MDfc73dQ+dJA3o5t7lkzpoa8QVdT9DGkY95a24k4z1rGsROywa0VY1splQzPDPa1I7Lo7Sc6P6MU=",
userId: user.id,
})
.onConflictDoNothing()
.returning();

const [profile] = await database
.insert(profiles)
.values({
userId: user.id,
displayName: "Test User",
})
.onConflictDoNothing()
.returning();
Expand Down

0 comments on commit 32409e7

Please sign in to comment.