You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{MigrationInterface,QueryRunner}from"typeorm";exportclasstest1658425247239implementsMigrationInterface{name='test1658425247239'publicasyncup(queryRunner: QueryRunner): Promise<void>{awaitqueryRunner.query(` CREATE TABLE "testEntity" ( "userId" uuid NOT NULL, "x" jsonb NOT NULL, CONSTRAINT "REL_3138077fc5fcc8a4e4e3c175f4" UNIQUE ("userId"), CONSTRAINT "PK_3138077fc5fcc8a4e4e3c175f40" PRIMARY KEY ("userId") ) `);awaitqueryRunner.query(` ALTER TABLE "testEntity" ADD CONSTRAINT "FK_3138077fc5fcc8a4e4e3c175f40" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION `);}publicasyncdown(queryRunner: QueryRunner): Promise<void>{awaitqueryRunner.query(` ALTER TABLE "testEntity" DROP CONSTRAINT "FK_3138077fc5fcc8a4e4e3c175f40" `);awaitqueryRunner.query(` DROP TABLE "testEntity" `);}}
Second Generated Migration File - Why ??
import{MigrationInterface,QueryRunner}from"typeorm";exportclasstest21658425259126implementsMigrationInterface{name='test21658425259126'publicasyncup(queryRunner: QueryRunner): Promise<void>{awaitqueryRunner.query(` ALTER TABLE "testEntity" DROP CONSTRAINT "FK_3138077fc5fcc8a4e4e3c175f40" `);awaitqueryRunner.query(` ALTER TABLE "testEntity" ADD CONSTRAINT "UQ_3138077fc5fcc8a4e4e3c175f40" UNIQUE ("userId") `);awaitqueryRunner.query(` ALTER TABLE "testEntity" ADD CONSTRAINT "FK_3138077fc5fcc8a4e4e3c175f40" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION `);}publicasyncdown(queryRunner: QueryRunner): Promise<void>{awaitqueryRunner.query(` ALTER TABLE "testEntity" DROP CONSTRAINT "FK_3138077fc5fcc8a4e4e3c175f40" `);awaitqueryRunner.query(` ALTER TABLE "testEntity" DROP CONSTRAINT "UQ_3138077fc5fcc8a4e4e3c175f40" `);awaitqueryRunner.query(` ALTER TABLE "testEntity" ADD CONSTRAINT "FK_3138077fc5fcc8a4e4e3c175f40" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION `);}}
Steps to Reproduce
Generate Migration
Run migrations
Generate Migration (expect not to generate, actual: generates new migration)
Issue Description
For some reason, TypeORM generates a second migration file after I run all migrations.
Expected Behavior
Typeorm would not generate second migration file.
Actual Behavior
Typeorm is generating a second migration file
Model Used
First Generated Migration File
Second Generated Migration File - Why ??
Steps to Reproduce
My Environment
Additional Context
Here are the list of packages we are using
Relevant Database Driver(s)
postgres
Are you willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: