Skip to content

Commit

Permalink
feat: run migration only in development and eslint-disable need to be…
Browse files Browse the repository at this point in the history
… at the top
  • Loading branch information
ixartz committed Apr 2, 2024
1 parent 93ea223 commit db94f31
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion next.config.mjs
@@ -1,5 +1,5 @@
import { withSentryConfig } from '@sentry/nextjs';
/* eslint-disable import/no-extraneous-dependencies, import/extensions */
import { withSentryConfig } from '@sentry/nextjs';
import './src/libs/Env.mjs';
import withBundleAnalyzer from '@next/bundle-analyzer';
import withNextIntl from 'next-intl/plugin';
Expand Down
2 changes: 1 addition & 1 deletion playwright.config.ts
Expand Up @@ -33,7 +33,7 @@ export default defineConfig({
// Run your local dev server before starting the tests:
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
webServer: {
command: process.env.CI ? 'npm run start' : 'npm run dev',
command: process.env.CI ? 'npm run start' : 'npm run dev:next',
url: baseURL,
timeout: 2 * 60 * 1000,
reuseExistingServer: !process.env.CI,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/DB.ts
Expand Up @@ -14,6 +14,6 @@ export const db = drizzle(client);
// Disable migrate function if using Edge runtime and use `npm run db:migrate` instead.
// Only run migrate in development. Otherwise, migrate will also be run during the build which can cause errors.
// Migrate during the build can cause errors due to the locked database when multiple migrations are running at the same time.
if (process.env.NODE_ENV !== 'production') {
if (process.env.NODE_ENV === 'development') {
await migrate(db, { migrationsFolder: './migrations' });
}

0 comments on commit db94f31

Please sign in to comment.