Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
farreldarian committed Apr 9, 2024
1 parent 245199c commit a21b935
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/usage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"start": "bun run src/index.ts",
"test": "bun test --preload tests/setup.ts",
"generate": "prisma generate",
"pushreset:postgres": "DATABASE_URL=$PG_DATABASE_URL bun prisma db push --schema prisma/schema.prisma --force-reset --accept-data-loss",
"pushreset:sqlite": "DATABASE_URL=$MYSQL_DATABASE_URL bun prisma db push --schema prisma/mysql/schema.prisma --force-reset --accept-data-loss",
"pushreset:mysql": "bun prisma db push --schema prisma/sqlite/schema.prisma --force-reset --accept-data-loss",
"pushreset:postgres": "bun prisma db push --schema prisma/schema.prisma --force-reset --accept-data-loss",
"pushreset:mysql": "bun prisma db push --schema prisma/mysql/schema.prisma --force-reset --accept-data-loss",
"pushreset:sqlite": "bun prisma db push --schema prisma/sqlite/schema.prisma --force-reset --accept-data-loss",
"clone:sqlite": "bun run scripts/cloneSqlite.ts",
"clone:mysql": "bun run scripts/cloneMysql.ts"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/usage/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ generator drizzle {

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
url = env("PG_DATABASE_URL")
}

model SelfReference {
Expand Down
1 change: 1 addition & 0 deletions packages/usage/scripts/cloneMysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const TARGET_PATH = './prisma/mysql/schema.prisma'

const schema = (await Bun.file(BASE_PATH).text())
.replace('postgresql', 'mysql')
.replace('PG_DATABASE_URL', 'MYSQL_DATABASE_URL')
.replace(/(\/\/ start -mysql\n)[\s\S]*?(\n\/\/ end -mysql)/g, '')
.replace(/^.*-mysql.*/gm, '')

Expand Down
2 changes: 1 addition & 1 deletion packages/usage/scripts/cloneSqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const TARGET_PATH = './prisma/sqlite/schema.prisma'

const schema = (await Bun.file(BASE_PATH).text())
.replace('postgresql', 'sqlite')
.replace('env("DATABASE_URL")', '"file:./test.db"')
.replace('env("PG_DATABASE_URL")', '"file:./test.db"')
.replace(/(\/\/ start -sqlite\n)[\s\S]*?(\n\/\/ end -sqlite)/g, '')
.replace(/^.*-sqlite.*/gm, '')

Expand Down

0 comments on commit a21b935

Please sign in to comment.