Skip to content

Commit 1cdcaa9

Browse files
fix(cli): cclean up prisma config
1 parent 43c27df commit 1cdcaa9

File tree

2 files changed

+4
-30
lines changed

2 files changed

+4
-30
lines changed

apps/cli/src/helpers/core/post-installation.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,9 @@ async function getDatabaseInstructions(
340340
`${pc.cyan("•")} Start docker container: ${`${runCmd} db:start`}`,
341341
);
342342
}
343-
instructions.push(`${pc.cyan("•")} Apply schema: ${`${runCmd} db:push`}`);
343+
if (!(dbSetup === "d1" && serverDeploy === "alchemy")) {
344+
instructions.push(`${pc.cyan("•")} Apply schema: ${`${runCmd} db:push`}`);
345+
}
344346
if (!(dbSetup === "d1" && serverDeploy === "alchemy")) {
345347
instructions.push(
346348
`${pc.cyan("•")} Database UI: ${`${runCmd} db:studio`}`,
Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,10 @@
11
import "dotenv/config";
22
import path from "node:path";
33
import type { PrismaConfig } from "prisma";
4-
{{#if (eq dbSetup "d1")}}
5-
import { PrismaD1 } from "@prisma/adapter-d1";
6-
{{/if}}
7-
{{#if (eq dbSetup "turso")}}
8-
import { PrismaLibSQL } from "@prisma/adapter-libsql";
9-
{{/if}}
104

115
export default {
12-
{{#if (or (eq dbSetup "d1") (eq dbSetup "turso"))}}
13-
experimental: {
14-
adapter: true
15-
},
16-
{{/if}}
176
schema: path.join("prisma", "schema"),
187
migrations: {
198
path: path.join("prisma", "migrations"),
20-
},
21-
{{#if (eq dbSetup "d1")}}
22-
async adapter() {
23-
return new PrismaD1({
24-
CLOUDFLARE_D1_TOKEN: process.env.CLOUDFLARE_D1_TOKEN,
25-
CLOUDFLARE_ACCOUNT_ID: process.env.CLOUDFLARE_ACCOUNT_ID,
26-
CLOUDFLARE_DATABASE_ID: process.env.CLOUDFLARE_DATABASE_ID,
27-
});
28-
},
29-
{{/if}}
30-
{{#if (eq dbSetup "turso")}}
31-
async adapter() {
32-
return new PrismaLibSQL({
33-
url: process.env.DATABASE_URL || "",
34-
authToken: process.env.DATABASE_AUTH_TOKEN,
35-
});
36-
},
37-
{{/if}}
9+
}
3810
} satisfies PrismaConfig;

0 commit comments

Comments
 (0)