(dbName: string)
| 315 | |
| 316 | // Function to run database migrations |
| 317 | async function runDatabaseMigrations(dbName: string) { |
| 318 | const setupMigrationSpinner = spinner(); |
| 319 | setupMigrationSpinner.start("Generating setup migration..."); |
| 320 | executeCommand("bunx drizzle-kit generate --name setup"); |
| 321 | setupMigrationSpinner.stop("Setup migration generated."); |
| 322 | |
| 323 | const localMigrationSpinner = spinner(); |
| 324 | localMigrationSpinner.start("Running local database migrations..."); |
| 325 | executeCommand(`bunx wrangler d1 migrations apply ${dbName}`); |
| 326 | localMigrationSpinner.stop("Local database migrations completed."); |
| 327 | |
| 328 | const remoteMigrationSpinner = spinner(); |
| 329 | remoteMigrationSpinner.start("Running remote database migrations..."); |
| 330 | executeCommand(`bunx wrangler d1 migrations apply ${dbName} --remote`); |
| 331 | remoteMigrationSpinner.stop("Remote database migrations completed."); |
| 332 | } |
| 333 | |
| 334 | function setEnvironmentVariable(name: string, value: string) { |
| 335 | const platform = os.platform(); |
no test coverage detected