Skip to content

Commit 62ef9fc

Browse files
authored
sst: two more fixes. (#3649)
1 parent e7f79f7 commit 62ef9fc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

examples/tanstack-db-web-starter/sst.config.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/// <reference path="./.sst/platform/config.d.ts" />
22

3-
import { execSync } from "node:child_process"
4-
53
export default $config({
64
app(input) {
75
return {
@@ -39,7 +37,7 @@ export default $config({
3937
}
4038

4139
// Apply migrations (idempotent)
42-
applyDrizzleMigrations(process.env.QUICKSTART_DATABASE_URI)
40+
await applyDrizzleMigrations(process.env.QUICKSTART_DATABASE_URI)
4341

4442
const website = new sst.aws.TanStackStart(`quickstart-website`, {
4543
environment: {
@@ -49,7 +47,7 @@ export default $config({
4947
// Electric
5048
ELECTRIC_URL: process.env.ELECTRIC_API,
5149
ELECTRIC_SOURCE_ID: process.env.QUICKSTART_SOURCE_ID,
52-
ELECTRIC_SOURCE_SECRET: process.env.QUICKSTART_SOURCE_SECRET,
50+
ELECTRIC_SECRET: process.env.QUICKSTART_SOURCE_SECRET,
5351

5452
// Better Auth
5553
BETTER_AUTH_SECRET: process.env.BETTER_AUTH_SECRET,
@@ -71,7 +69,8 @@ export default $config({
7169
* Apply migrations using Drizzle Kit.
7270
* Migrations are in src/db/out/ (generated by drizzle-kit generate).
7371
*/
74-
function applyDrizzleMigrations(dbUri: string) {
72+
async function applyDrizzleMigrations(dbUri: string) {
73+
const { execSync } = await import("node:child_process")
7574
console.log(`[quickstart] Applying Drizzle migrations`)
7675
execSync(`pnpm drizzle-kit migrate`, {
7776
env: {

0 commit comments

Comments
 (0)