Hi.
When I’m trying to deploy my NestJS project with connected postgre, columns are not created automatically.
This is Dockerfile:
FROM node:lts-alpine3.15
EXPOSE ${PORT}
WORKDIR /home/app/
RUN mkdir -p ./dist
RUN mkdir -p ./uploads
RUN mkdir -p ./logs
COPY migrations ./migrations
COPY typings ./typings
COPY src ./src
COPY package*.json tsconfig.json tsconfig.build.json ./
RUN npm ci
RUN npm run build
This is app.module part:
TypeOrmModule.forRoot({
...ormconfig,
entities: [`${__dirname}/resources/**/**.entity{.ts,.js}`],
migrations: [`${__dirname}/migrations/*.ts`],
}),
And migrations file looks like this:
export class newTables1653159327291 implements MigrationInterface {
name = 'newTables1653159327291'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TABLE "columns" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "title" character varying NOT NULL, "order" integer NOT NULL, "boardId" uuid, CONSTRAINT "PK_4ac339ccbbfed1dcd96812abbd5" PRIMARY KEY ("id"))`);
Also when I try to build project using: nest build && npm run typeorm:migration
, I have an error:
Error during migration run:
Error: Debug Failure. False expression: Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.
Sorry, I’m not good at backend part.