-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: only run migration after generate schema
- Loading branch information
Showing
4 changed files
with
15 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
FROM node | ||
|
||
FROM node:lts-alpine3.18 | ||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN npm i && \ | ||
npm run generate && \ | ||
rm -rf node_modules && \ | ||
npm ci --omit=dev | ||
RUN npm i | ||
RUN npm run generate | ||
RUN npx tsx ./src/db/postgres/migrate.ts | ||
RUN rm -rf node_modules | ||
RUN npm ci --omit=dev | ||
|
||
ENTRYPOINT [ "npx", "tsx", "./src/main.ts" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { migrate } from 'drizzle-orm/libsql/migrator' | ||
import { db } from '.' | ||
|
||
console.log('Running migration...') | ||
await migrate(db, { migrationsFolder: './drizzle' }) | ||
console.log('Migrations is done') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters