mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
fix(cli): cclean up prisma config
This commit is contained in:
@@ -340,7 +340,9 @@ async function getDatabaseInstructions(
|
||||
`${pc.cyan("•")} Start docker container: ${`${runCmd} db:start`}`,
|
||||
);
|
||||
}
|
||||
if (!(dbSetup === "d1" && serverDeploy === "alchemy")) {
|
||||
instructions.push(`${pc.cyan("•")} Apply schema: ${`${runCmd} db:push`}`);
|
||||
}
|
||||
if (!(dbSetup === "d1" && serverDeploy === "alchemy")) {
|
||||
instructions.push(
|
||||
`${pc.cyan("•")} Database UI: ${`${runCmd} db:studio`}`,
|
||||
|
||||
@@ -1,38 +1,10 @@
|
||||
import "dotenv/config";
|
||||
import path from "node:path";
|
||||
import type { PrismaConfig } from "prisma";
|
||||
{{#if (eq dbSetup "d1")}}
|
||||
import { PrismaD1 } from "@prisma/adapter-d1";
|
||||
{{/if}}
|
||||
{{#if (eq dbSetup "turso")}}
|
||||
import { PrismaLibSQL } from "@prisma/adapter-libsql";
|
||||
{{/if}}
|
||||
|
||||
export default {
|
||||
{{#if (or (eq dbSetup "d1") (eq dbSetup "turso"))}}
|
||||
experimental: {
|
||||
adapter: true
|
||||
},
|
||||
{{/if}}
|
||||
schema: path.join("prisma", "schema"),
|
||||
migrations: {
|
||||
path: path.join("prisma", "migrations"),
|
||||
},
|
||||
{{#if (eq dbSetup "d1")}}
|
||||
async adapter() {
|
||||
return new PrismaD1({
|
||||
CLOUDFLARE_D1_TOKEN: process.env.CLOUDFLARE_D1_TOKEN,
|
||||
CLOUDFLARE_ACCOUNT_ID: process.env.CLOUDFLARE_ACCOUNT_ID,
|
||||
CLOUDFLARE_DATABASE_ID: process.env.CLOUDFLARE_DATABASE_ID,
|
||||
});
|
||||
},
|
||||
{{/if}}
|
||||
{{#if (eq dbSetup "turso")}}
|
||||
async adapter() {
|
||||
return new PrismaLibSQL({
|
||||
url: process.env.DATABASE_URL || "",
|
||||
authToken: process.env.DATABASE_AUTH_TOKEN,
|
||||
});
|
||||
},
|
||||
{{/if}}
|
||||
}
|
||||
} satisfies PrismaConfig;
|
||||
|
||||
Reference in New Issue
Block a user