Untitled

 avatar
unknown
plain_text
24 days ago
4.0 kB
6
Indexable
root@prod-new:~# docker logs mamaroma_bakki_qtim_ru_-migration-1

> school-back@0.0.1 migration:run
> npm run typeorm migration:run -- -d src/config/orm.config.ts


> school-back@0.0.1 typeorm
> ts-node --files ./node_modules/typeorm/cli.js migration:run -d src/config/orm.config.ts

query: SELECT * FROM current_schema()
query: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
query: SELECT version();
query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = 'public' AND "table_name" = 'migrations'
query: SELECT * FROM "migrations" "migrations" ORDER BY "id" DESC
129 migrations are already loaded in the database.
133 migrations were found in the source code.
AttestationUserWidget1732108512875 is the last executed migration. It was executed on Wed Nov 20 2024 13:15:12 GMT+0000 (Coordinated Universal Time).
4 migrations are new migrations must be executed.
query: START TRANSACTION
query: DELETE FROM "users" WHERE "deletedAt" IS NOT NULL
query failed: DELETE FROM "users" WHERE "deletedAt" IS NOT NULL
error: error: update or delete on table "users" violates foreign key constraint "FK_06aa5d361a3a9ab164b1223940b" on table "sertification_attempts"
query: ROLLBACK
Error during migration run:
QueryFailedError: update or delete on table "users" violates foreign key constraint "FK_06aa5d361a3a9ab164b1223940b" on table "sertification_attempts"
    at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/src/driver/postgres/PostgresQueryRunner.ts:299:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async RemoveDeletedUsers1735045873635.up (/usr/src/app/src/migrations/1735045873635-removeDeletedUsers.ts:5:5)
    at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/src/migration/MigrationExecutor.ts:336:17)
    at async DataSource.runMigrations (/usr/src/app/node_modules/src/data-source/DataSource.ts:397:13)
    at async Object.handler (/usr/src/app/node_modules/src/commands/MigrationRunCommand.ts:76:13) {
  query: 'DELETE FROM "users" WHERE "deletedAt" IS NOT NULL',
  parameters: undefined,
  driverError: error: update or delete on table "users" violates foreign key constraint "FK_06aa5d361a3a9ab164b1223940b" on table "sertification_attempts"
      at /usr/src/app/node_modules/pg/lib/client.js:526:17
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/src/driver/postgres/PostgresQueryRunner.ts:249:25)
      at async RemoveDeletedUsers1735045873635.up (/usr/src/app/src/migrations/1735045873635-removeDeletedUsers.ts:5:5)
      at async MigrationExecutor.executePendingMigrations (/usr/src/app/node_modules/src/migration/MigrationExecutor.ts:336:17)
      at async DataSource.runMigrations (/usr/src/app/node_modules/src/data-source/DataSource.ts:397:13)
      at async Object.handler (/usr/src/app/node_modules/src/commands/MigrationRunCommand.ts:76:13) {
    length: 371,
    severity: 'ERROR',
    code: '23503',
    detail: 'Key (id)=(4efa0ac9-5e95-4a44-a10e-e0bd1c1c3804) is still referenced from table "sertification_attempts".',
    hint: undefined,
    position: undefined,
    internalPosition: undefined,
    internalQuery: undefined,
    where: undefined,
    schema: 'public',
    table: 'sertification_attempts',
    column: undefined,
    dataType: undefined,
    constraint: 'FK_06aa5d361a3a9ab164b1223940b',
    file: 'ri_triggers.c',
    line: '2541',
    routine: 'ri_ReportViolation'
  },
  length: 371,
  severity: 'ERROR',
  code: '23503',
  detail: 'Key (id)=(4efa0ac9-5e95-4a44-a10e-e0bd1c1c3804) is still referenced from table "sertification_attempts".',
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: 'public',
  table: 'sertification_attempts',
  column: undefined,
  dataType: undefined,
  constraint: 'FK_06aa5d361a3a9ab164b1223940b',
  file: 'ri_triggers.c',
  line: '2541',
  routine: 'ri_ReportViolation'
}
Leave a Comment