|
|
|
@ -1,93 +1,93 @@
|
|
|
|
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
|
|
|
|
|
|
export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
name = 'initialMigration1596905308513';
|
|
|
|
|
export class initialMigration1597703268172 implements MigrationInterface {
|
|
|
|
|
name = 'initialMigration1597703268172';
|
|
|
|
|
|
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "author_role_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "author_role_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "author_role" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL, "description" varchar NOT NULL)`
|
|
|
|
|
`CREATE TABLE "author_role" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL DEFAULT (''), "description" varchar NOT NULL DEFAULT (''))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "collection_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "collection_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "collection" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL)`
|
|
|
|
|
`CREATE TABLE "collection" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL DEFAULT (''))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "collection_part" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "order" integer NOT NULL DEFAULT (0), "collectionId" integer NOT NULL, "workId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "site_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "site_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "site" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL)`
|
|
|
|
|
`CREATE TABLE "site" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL DEFAULT (''))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "source" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "uri" varchar NOT NULL, "siteId" integer)`
|
|
|
|
|
`CREATE TABLE "source" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "uri" varchar NOT NULL DEFAULT (''), "siteId" integer)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "copy" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "hash" varchar NOT NULL, "location" varchar, "ranking" integer NOT NULL DEFAULT (0), "originalId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "copy" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "hash" varchar NOT NULL DEFAULT (''), "location" text, "ranking" integer NOT NULL DEFAULT (0), "originalId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(`CREATE TABLE "language" ("code" varchar PRIMARY KEY NOT NULL)`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "transformation_type_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "transformation_type_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "transformation_type" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL, "description" varchar, "conservesTags" boolean NOT NULL DEFAULT (0))`
|
|
|
|
|
`CREATE TABLE "transformation_type" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL DEFAULT (''), "description" varchar NOT NULL DEFAULT (''), "conservesTags" boolean NOT NULL DEFAULT (0))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "transformation" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "order" integer NOT NULL DEFAULT (0), "byWorkId" integer NOT NULL, "typeId" integer NOT NULL, "ofWorkId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "interaction_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer NOT NULL, "tagId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991))`
|
|
|
|
|
`CREATE TABLE "interaction_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer, "tagId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "tag_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "tag_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "work_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer NOT NULL, "tagId" integer NOT NULL, "workId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991))`
|
|
|
|
|
`CREATE TABLE "work_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer, "tagId" integer NOT NULL, "workId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL, "description" varchar)`
|
|
|
|
|
`CREATE TABLE "tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL DEFAULT (''), "description" varchar NOT NULL DEFAULT (''))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "character_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer NOT NULL, "workCharacterId" integer NOT NULL, "tagId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991))`
|
|
|
|
|
`CREATE TABLE "character_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer, "workCharacterId" integer NOT NULL, "tagId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "work_character_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "work_character_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "world_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "world_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "world" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL)`
|
|
|
|
|
`CREATE TABLE "world" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL DEFAULT (''))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "world_character_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "world_character_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "world_character" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL)`
|
|
|
|
|
`CREATE TABLE "world_character" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL DEFAULT (''))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "work_character" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL)`
|
|
|
|
|
`CREATE TABLE "work_character" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL DEFAULT (''))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "work_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "work_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "work" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL, "isCanonical" boolean NOT NULL DEFAULT (0), "rating" integer, "releaseDate" datetime, CONSTRAINT "rating needs to be between 0 and 9007199254740991" CHECK (rating >= 0 AND rating <= 9007199254740991))`
|
|
|
|
|
`CREATE TABLE "work" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL DEFAULT (''), "isCanonical" boolean NOT NULL DEFAULT (0), "rating" integer, "releaseDate" date, CONSTRAINT "rating needs to be between 0 and 9007199254740991" CHECK (rating >= 0 AND rating <= 9007199254740991))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "work_author" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "order" integer NOT NULL DEFAULT (0), "workId" integer NOT NULL, "authorId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "author" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL)`
|
|
|
|
|
`CREATE TABLE "author" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "nameCanonical" varchar NOT NULL DEFAULT (''))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "author_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "author_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "copy_sources_source" ("copyId" integer NOT NULL, "sourceId" integer NOT NULL, PRIMARY KEY ("copyId", "sourceId"))`
|
|
|
|
@ -171,7 +171,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
`CREATE INDEX "IDX_1f53233757f73a30345a845b36" ON "work_author_author_roles_author_role" ("authorRoleId") `
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_author_role_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL, CONSTRAINT "FK_53007d787184883d4f88f518213" FOREIGN KEY ("entityId") REFERENCES "author_role" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_author_role_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL, CONSTRAINT "FK_53007d787184883d4f88f518213" FOREIGN KEY ("entityId") REFERENCES "author_role" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_author_role_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "author_role_name"`
|
|
|
|
@ -179,7 +179,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "author_role_name"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "temporary_author_role_name" RENAME TO "author_role_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_collection_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL, CONSTRAINT "FK_e32c613ebf793bdec166b99c67c" FOREIGN KEY ("entityId") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_collection_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL, CONSTRAINT "FK_e32c613ebf793bdec166b99c67c" FOREIGN KEY ("entityId") REFERENCES "collection" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_collection_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "collection_name"`
|
|
|
|
@ -195,7 +195,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "collection_part"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "temporary_collection_part" RENAME TO "collection_part"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_site_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL, CONSTRAINT "FK_320041fe1c2631a761b25d4446a" FOREIGN KEY ("entityId") REFERENCES "site" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_site_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL, CONSTRAINT "FK_320041fe1c2631a761b25d4446a" FOREIGN KEY ("entityId") REFERENCES "site" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_site_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "site_name"`
|
|
|
|
@ -203,7 +203,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "site_name"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "temporary_site_name" RENAME TO "site_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_source" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "uri" varchar NOT NULL, "siteId" integer, CONSTRAINT "FK_73b253e679f350d140bdb104e49" FOREIGN KEY ("siteId") REFERENCES "site" ("id") ON DELETE RESTRICT ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_source" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "uri" varchar NOT NULL DEFAULT (''), "siteId" integer, CONSTRAINT "FK_73b253e679f350d140bdb104e49" FOREIGN KEY ("siteId") REFERENCES "site" ("id") ON DELETE RESTRICT ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_source"("id", "uri", "siteId") SELECT "id", "uri", "siteId" FROM "source"`
|
|
|
|
@ -211,7 +211,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "source"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "temporary_source" RENAME TO "source"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_copy" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "hash" varchar NOT NULL, "location" varchar, "ranking" integer NOT NULL DEFAULT (0), "originalId" integer NOT NULL, CONSTRAINT "FK_e8ce0011cf0a8b9fdc8ad908a44" FOREIGN KEY ("originalId") REFERENCES "work" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_copy" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "hash" varchar NOT NULL DEFAULT (''), "location" text, "ranking" integer NOT NULL DEFAULT (0), "originalId" integer NOT NULL, CONSTRAINT "FK_e8ce0011cf0a8b9fdc8ad908a44" FOREIGN KEY ("originalId") REFERENCES "work" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_copy"("id", "hash", "location", "ranking", "originalId") SELECT "id", "hash", "location", "ranking", "originalId" FROM "copy"`
|
|
|
|
@ -219,7 +219,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "copy"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "temporary_copy" RENAME TO "copy"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_transformation_type_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL, CONSTRAINT "FK_5bc54ac960e6587c39297194ec6" FOREIGN KEY ("entityId") REFERENCES "transformation_type" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_transformation_type_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL, CONSTRAINT "FK_5bc54ac960e6587c39297194ec6" FOREIGN KEY ("entityId") REFERENCES "transformation_type" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_transformation_type_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "transformation_type_name"`
|
|
|
|
@ -235,7 +235,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "transformation"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "temporary_transformation" RENAME TO "transformation"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_interaction_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer NOT NULL, "tagId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991), CONSTRAINT "FK_af4c7e7219611f6b6025b8276f0" FOREIGN KEY ("tagId") REFERENCES "tag" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_interaction_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer, "tagId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991), CONSTRAINT "FK_af4c7e7219611f6b6025b8276f0" FOREIGN KEY ("tagId") REFERENCES "tag" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_interaction_tag"("id", "weight", "tagId") SELECT "id", "weight", "tagId" FROM "interaction_tag"`
|
|
|
|
@ -243,7 +243,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "interaction_tag"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "temporary_interaction_tag" RENAME TO "interaction_tag"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_tag_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL, CONSTRAINT "FK_94c570315f982d2434046c30dc1" FOREIGN KEY ("entityId") REFERENCES "tag" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_tag_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL, CONSTRAINT "FK_94c570315f982d2434046c30dc1" FOREIGN KEY ("entityId") REFERENCES "tag" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_tag_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "tag_name"`
|
|
|
|
@ -251,7 +251,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "tag_name"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "temporary_tag_name" RENAME TO "tag_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_work_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer NOT NULL, "tagId" integer NOT NULL, "workId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991), CONSTRAINT "FK_8428f32a2c63df16b605e77326e" FOREIGN KEY ("tagId") REFERENCES "tag" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "FK_13dd6d2f7b58c451636bf28b4f8" FOREIGN KEY ("workId") REFERENCES "work" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_work_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer, "tagId" integer NOT NULL, "workId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991), CONSTRAINT "FK_8428f32a2c63df16b605e77326e" FOREIGN KEY ("tagId") REFERENCES "tag" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "FK_13dd6d2f7b58c451636bf28b4f8" FOREIGN KEY ("workId") REFERENCES "work" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_work_tag"("id", "weight", "tagId", "workId") SELECT "id", "weight", "tagId", "workId" FROM "work_tag"`
|
|
|
|
@ -259,7 +259,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "work_tag"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "temporary_work_tag" RENAME TO "work_tag"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_character_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer NOT NULL, "workCharacterId" integer NOT NULL, "tagId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991), CONSTRAINT "FK_0c27931804d469fba75a2c5d357" FOREIGN KEY ("workCharacterId") REFERENCES "work_character" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "FK_14ffc3712f3341e793668b2cd61" FOREIGN KEY ("tagId") REFERENCES "tag" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_character_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer, "workCharacterId" integer NOT NULL, "tagId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991), CONSTRAINT "FK_0c27931804d469fba75a2c5d357" FOREIGN KEY ("workCharacterId") REFERENCES "work_character" ("id") ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT "FK_14ffc3712f3341e793668b2cd61" FOREIGN KEY ("tagId") REFERENCES "tag" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_character_tag"("id", "weight", "workCharacterId", "tagId") SELECT "id", "weight", "workCharacterId", "tagId" FROM "character_tag"`
|
|
|
|
@ -267,7 +267,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "character_tag"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "temporary_character_tag" RENAME TO "character_tag"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_work_character_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL, CONSTRAINT "FK_0f95e554fd5bd674937f733f219" FOREIGN KEY ("entityId") REFERENCES "work_character" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_work_character_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL, CONSTRAINT "FK_0f95e554fd5bd674937f733f219" FOREIGN KEY ("entityId") REFERENCES "work_character" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_work_character_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "work_character_name"`
|
|
|
|
@ -275,7 +275,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "work_character_name"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "temporary_work_character_name" RENAME TO "work_character_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_world_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL, CONSTRAINT "FK_1147cb1b497ecbf3b8d3c2ac1b3" FOREIGN KEY ("entityId") REFERENCES "world" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_world_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL, CONSTRAINT "FK_1147cb1b497ecbf3b8d3c2ac1b3" FOREIGN KEY ("entityId") REFERENCES "world" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_world_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "world_name"`
|
|
|
|
@ -283,7 +283,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "world_name"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "temporary_world_name" RENAME TO "world_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_world_character_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL, CONSTRAINT "FK_00fb48ee8ded5c6bc3061c83cbb" FOREIGN KEY ("entityId") REFERENCES "world_character" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_world_character_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL, CONSTRAINT "FK_00fb48ee8ded5c6bc3061c83cbb" FOREIGN KEY ("entityId") REFERENCES "world_character" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_world_character_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "world_character_name"`
|
|
|
|
@ -291,7 +291,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "world_character_name"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "temporary_world_character_name" RENAME TO "world_character_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_work_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL, CONSTRAINT "FK_e9887937be670e7056b2ce480d2" FOREIGN KEY ("entityId") REFERENCES "work" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_work_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL, CONSTRAINT "FK_e9887937be670e7056b2ce480d2" FOREIGN KEY ("entityId") REFERENCES "work" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_work_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "work_name"`
|
|
|
|
@ -307,7 +307,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "work_author"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "temporary_work_author" RENAME TO "work_author"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "temporary_author_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL, CONSTRAINT "FK_fb4e8ac4593d1c4d5b10c013d41" FOREIGN KEY ("entityId") REFERENCES "author" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
`CREATE TABLE "temporary_author_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL, CONSTRAINT "FK_fb4e8ac4593d1c4d5b10c013d41" FOREIGN KEY ("entityId") REFERENCES "author" ("id") ON DELETE CASCADE ON UPDATE CASCADE)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "temporary_author_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "author_name"`
|
|
|
|
@ -663,7 +663,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`CREATE INDEX "IDX_653c33c5db26b8736e592ff3f6" ON "copy_sources_source" ("copyId") `);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "author_name" RENAME TO "temporary_author_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "author_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "author_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "author_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "temporary_author_name"`
|
|
|
|
@ -679,7 +679,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "temporary_work_author"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "work_name" RENAME TO "temporary_work_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "work_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "work_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "work_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "temporary_work_name"`
|
|
|
|
@ -687,7 +687,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "temporary_work_name"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "world_character_name" RENAME TO "temporary_world_character_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "world_character_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "world_character_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "world_character_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "temporary_world_character_name"`
|
|
|
|
@ -695,7 +695,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "temporary_world_character_name"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "world_name" RENAME TO "temporary_world_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "world_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "world_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "world_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "temporary_world_name"`
|
|
|
|
@ -703,7 +703,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "temporary_world_name"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "work_character_name" RENAME TO "temporary_work_character_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "work_character_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "work_character_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "work_character_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "temporary_work_character_name"`
|
|
|
|
@ -711,7 +711,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "temporary_work_character_name"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "character_tag" RENAME TO "temporary_character_tag"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "character_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer NOT NULL, "workCharacterId" integer NOT NULL, "tagId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991))`
|
|
|
|
|
`CREATE TABLE "character_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer, "workCharacterId" integer NOT NULL, "tagId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "character_tag"("id", "weight", "workCharacterId", "tagId") SELECT "id", "weight", "workCharacterId", "tagId" FROM "temporary_character_tag"`
|
|
|
|
@ -719,7 +719,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "temporary_character_tag"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "work_tag" RENAME TO "temporary_work_tag"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "work_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer NOT NULL, "tagId" integer NOT NULL, "workId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991))`
|
|
|
|
|
`CREATE TABLE "work_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer, "tagId" integer NOT NULL, "workId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "work_tag"("id", "weight", "tagId", "workId") SELECT "id", "weight", "tagId", "workId" FROM "temporary_work_tag"`
|
|
|
|
@ -727,7 +727,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "temporary_work_tag"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "tag_name" RENAME TO "temporary_tag_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "tag_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "tag_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "tag_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "temporary_tag_name"`
|
|
|
|
@ -735,7 +735,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "temporary_tag_name"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "interaction_tag" RENAME TO "temporary_interaction_tag"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "interaction_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer NOT NULL, "tagId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991))`
|
|
|
|
|
`CREATE TABLE "interaction_tag" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "weight" integer, "tagId" integer NOT NULL, CONSTRAINT "weight needs to be between 0 and 9007199254740991" CHECK (weight >= 0 AND weight <= 9007199254740991))`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "interaction_tag"("id", "weight", "tagId") SELECT "id", "weight", "tagId" FROM "temporary_interaction_tag"`
|
|
|
|
@ -751,7 +751,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "temporary_transformation"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "transformation_type_name" RENAME TO "temporary_transformation_type_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "transformation_type_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "transformation_type_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "transformation_type_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "temporary_transformation_type_name"`
|
|
|
|
@ -759,7 +759,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "temporary_transformation_type_name"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "copy" RENAME TO "temporary_copy"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "copy" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "hash" varchar NOT NULL, "location" varchar, "ranking" integer NOT NULL DEFAULT (0), "originalId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "copy" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "hash" varchar NOT NULL DEFAULT (''), "location" text, "ranking" integer NOT NULL DEFAULT (0), "originalId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "copy"("id", "hash", "location", "ranking", "originalId") SELECT "id", "hash", "location", "ranking", "originalId" FROM "temporary_copy"`
|
|
|
|
@ -767,7 +767,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "temporary_copy"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "source" RENAME TO "temporary_source"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "source" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "uri" varchar NOT NULL, "siteId" integer)`
|
|
|
|
|
`CREATE TABLE "source" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "uri" varchar NOT NULL DEFAULT (''), "siteId" integer)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "source"("id", "uri", "siteId") SELECT "id", "uri", "siteId" FROM "temporary_source"`
|
|
|
|
@ -775,7 +775,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "temporary_source"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "site_name" RENAME TO "temporary_site_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "site_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "site_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "site_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "temporary_site_name"`
|
|
|
|
@ -791,7 +791,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "temporary_collection_part"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "collection_name" RENAME TO "temporary_collection_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "collection_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "collection_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "collection_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "temporary_collection_name"`
|
|
|
|
@ -799,7 +799,7 @@ export class initialMigration1596905308513 implements MigrationInterface {
|
|
|
|
|
await queryRunner.query(`DROP TABLE "temporary_collection_name"`);
|
|
|
|
|
await queryRunner.query(`ALTER TABLE "author_role_name" RENAME TO "temporary_author_role_name"`);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`CREATE TABLE "author_role_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "entityId" integer NOT NULL)`
|
|
|
|
|
`CREATE TABLE "author_role_name" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL DEFAULT (''), "entityId" integer NOT NULL)`
|
|
|
|
|
);
|
|
|
|
|
await queryRunner.query(
|
|
|
|
|
`INSERT INTO "author_role_name"("id", "name", "entityId") SELECT "id", "name", "entityId" FROM "temporary_author_role_name"`
|