mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
Rename database environment variables for consistency
This commit is contained in:
@@ -56,8 +56,8 @@ export async function setupEnvironmentVariables(
|
||||
}
|
||||
|
||||
if (options.database === "sqlite" && options.dbSetup !== "turso") {
|
||||
if (!envContent.includes("TURSO_CONNECTION_URL")) {
|
||||
envContent += "\nTURSO_CONNECTION_URL=file:./local.db";
|
||||
if (!envContent.includes("DATABASE_URL")) {
|
||||
envContent += "\nDATABASE_URL=file:./local.db";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,11 +104,6 @@ function getDatabaseInstructions(
|
||||
instructions.push(`${pc.cyan("•")} Apply schema: ${`${runCmd} db:push`}`);
|
||||
instructions.push(`${pc.cyan("•")} Database UI: ${`${runCmd} db:studio`}`);
|
||||
} else if (orm === "drizzle") {
|
||||
if (database === "sqlite") {
|
||||
instructions.push(
|
||||
`${pc.cyan("•")} Start local DB: ${`cd apps/server && ${runCmd} db:local`}`,
|
||||
);
|
||||
}
|
||||
instructions.push(`${pc.cyan("•")} Apply schema: ${`${runCmd} db:push`}`);
|
||||
instructions.push(`${pc.cyan("•")} Database UI: ${`${runCmd} db:studio`}`);
|
||||
}
|
||||
|
||||
@@ -157,10 +157,10 @@ async function createTursoDatabase(
|
||||
async function writeEnvFile(projectDir: string, config?: TursoConfig) {
|
||||
const envPath = path.join(projectDir, "apps/server", ".env");
|
||||
const envContent = config
|
||||
? `TURSO_CONNECTION_URL="${config.dbUrl}"
|
||||
TURSO_AUTH_TOKEN="${config.authToken}"`
|
||||
: `TURSO_CONNECTION_URL=
|
||||
TURSO_AUTH_TOKEN=`;
|
||||
? `DATABASE_URL="${config.dbUrl}"
|
||||
DATABASE_AUTH_TOKEN="${config.authToken}"`
|
||||
: `DATABASE_URL=
|
||||
DATABASE_AUTH_TOKEN=`;
|
||||
|
||||
await fs.writeFile(envPath, envContent);
|
||||
}
|
||||
@@ -173,8 +173,8 @@ function displayManualSetupInstructions() {
|
||||
3. Get your database URL and authentication token
|
||||
4. Add these credentials to the .env file in apps/server/.env
|
||||
|
||||
TURSO_CONNECTION_URL=your_database_url
|
||||
TURSO_AUTH_TOKEN=your_auth_token`);
|
||||
DATABASE_URL=your_database_url
|
||||
DATABASE_AUTH_TOKEN=your_auth_token`);
|
||||
}
|
||||
|
||||
export async function setupTurso(
|
||||
|
||||
Reference in New Issue
Block a user