Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit a829b6f

Browse files
committed
Don't migrate db automatically while in development
1 parent 6d9ed25 commit a829b6f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/server/php.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,15 @@ function serveApp(secret, apiPort): Promise<ProcessResult> {
167167
callPhp(['artisan', 'storage:link', '--force'], phpOptions)
168168

169169
// Migrate the database
170-
if (store.get('migrated_version') !== app.getVersion() || process.env.NODE_ENV === 'development') {
170+
if (store.get('migrated_version') !== app.getVersion() && process.env.NODE_ENV !== 'development') {
171171
console.log('Migrating database...')
172172
callPhp(['artisan', 'migrate', '--force'], phpOptions)
173173
store.set('migrated_version', app.getVersion())
174-
} else {
175-
console.log('Database already migrated', store.get('migrated_version'))
174+
}
175+
176+
if (process.env.NODE_ENV === 'development') {
177+
console.log('Skipping Database migration while in development.')
178+
console.log('You may migrate manually by running: php artisan native:migrate')
176179
}
177180

178181
const phpPort = await getPhpPort();

0 commit comments

Comments
 (0)