Convert all remaining entity-manager migrations to raw SQL
TypeORM's manager.save/delete with string table names still uses entity metadata internally (triggers SELECT with all entity columns). Converted SeedSubgenres, RemoveLastGenres, and SeedEpisodicSubgenres to use queryRunner.query() with raw SQL to avoid column mismatches. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { In, MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class SeedSubgenres1730125784613 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
@@ -21,465 +20,123 @@ export class SeedSubgenres1730125784613 implements MigrationInterface {
|
||||
'03342d8a-9fa0-4df1-9047-52c226b43b05',
|
||||
];
|
||||
|
||||
await queryRunner.manager.delete('project_genres', {
|
||||
genre_id: In(genresToRemove),
|
||||
});
|
||||
const deletePlaceholders = genresToRemove.map((_, i) => `$${i + 1}`).join(', ');
|
||||
await queryRunner.query(
|
||||
`DELETE FROM "project_genres" WHERE "genre_id" IN (${deletePlaceholders})`,
|
||||
genresToRemove,
|
||||
);
|
||||
|
||||
await queryRunner.manager.delete('genres', {
|
||||
id: In(genresToRemove),
|
||||
});
|
||||
await queryRunner.query(
|
||||
`DELETE FROM "genres" WHERE "id" IN (${deletePlaceholders})`,
|
||||
genresToRemove,
|
||||
);
|
||||
|
||||
const newGenres = [
|
||||
{
|
||||
id: '03342d8a-9fa0-4df1-9047-52c226b43b05',
|
||||
name: 'Animation',
|
||||
},
|
||||
];
|
||||
|
||||
await queryRunner.manager.save('genres', newGenres);
|
||||
await queryRunner.query(
|
||||
`INSERT INTO "genres" ("id", "name") VALUES ($1, $2) ON CONFLICT ("id") DO NOTHING`,
|
||||
['03342d8a-9fa0-4df1-9047-52c226b43b05', 'Animation'],
|
||||
);
|
||||
|
||||
const subgenres = [
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3676ab4e-1b4f-4568-836a-43f84b1a6228',
|
||||
name: 'Adventure',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3676ab4e-1b4f-4568-836a-43f84b1a6228',
|
||||
name: 'Disaster',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3676ab4e-1b4f-4568-836a-43f84b1a6228',
|
||||
name: 'Martial Arts',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3676ab4e-1b4f-4568-836a-43f84b1a6228',
|
||||
name: 'Military Action',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3676ab4e-1b4f-4568-836a-43f84b1a6228',
|
||||
name: 'Spy/Espionage',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3676ab4e-1b4f-4568-836a-43f84b1a6228',
|
||||
name: 'Superhero',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3676ab4e-1b4f-4568-836a-43f84b1a6228',
|
||||
name: 'Video Game Movies',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '03342d8a-9fa0-4df1-9047-52c226b43b05',
|
||||
name: 'CGI',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '03342d8a-9fa0-4df1-9047-52c226b43b05',
|
||||
name: 'Claymation/Stop Motion',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '03342d8a-9fa0-4df1-9047-52c226b43b05',
|
||||
name: 'Traditional Drawn',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '03342d8a-9fa0-4df1-9047-52c226b43b05',
|
||||
name: 'Cutout Animation',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '03342d8a-9fa0-4df1-9047-52c226b43b05',
|
||||
name: 'Live-Action Hybrid',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '03342d8a-9fa0-4df1-9047-52c226b43b05',
|
||||
name: 'Puppet Animation',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841',
|
||||
name: 'Black/Dark Comedy',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841',
|
||||
name: 'Buddy Comedy',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841',
|
||||
name: 'Hangout Movies',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841',
|
||||
name: 'Parody/Spoof',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841',
|
||||
name: 'Prank Movies',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841',
|
||||
name: 'Satire',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841',
|
||||
name: 'Slapstick',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841',
|
||||
name: 'Screwball',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'e9e4285c-b6f3-46ef-a991-bd9f1537eae1',
|
||||
name: 'Cop Movies',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'e9e4285c-b6f3-46ef-a991-bd9f1537eae1',
|
||||
name: 'Crime Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'e9e4285c-b6f3-46ef-a991-bd9f1537eae1',
|
||||
name: 'Crime Thriller',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'e9e4285c-b6f3-46ef-a991-bd9f1537eae1',
|
||||
name: 'Detective/Whodunnit',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'e9e4285c-b6f3-46ef-a991-bd9f1537eae1',
|
||||
name: 'Gangster Films',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'e9e4285c-b6f3-46ef-a991-bd9f1537eae1',
|
||||
name: 'Hardboiled',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'e9e4285c-b6f3-46ef-a991-bd9f1537eae1',
|
||||
name: 'Heist/Caper',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b',
|
||||
name: 'Expository',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b',
|
||||
name: 'Observational',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b',
|
||||
name: 'Poetic',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b',
|
||||
name: 'Participatory',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b',
|
||||
name: 'Historical',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b',
|
||||
name: 'Reflexive',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b',
|
||||
name: 'Nature/Wildlife',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b',
|
||||
name: 'Social Issue',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b',
|
||||
name: 'Biographical',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b',
|
||||
name: 'Performative',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '01854d65-636e-476b-9bbd-881c1834cdb0',
|
||||
name: 'Docudrama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '01854d65-636e-476b-9bbd-881c1834cdb0',
|
||||
name: 'Melodrama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '01854d65-636e-476b-9bbd-881c1834cdb0',
|
||||
name: 'Teen Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '01854d65-636e-476b-9bbd-881c1834cdb0',
|
||||
name: 'Medical Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '01854d65-636e-476b-9bbd-881c1834cdb0',
|
||||
name: 'Legal Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '01854d65-636e-476b-9bbd-881c1834cdb0',
|
||||
name: 'Religious Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '01854d65-636e-476b-9bbd-881c1834cdb0',
|
||||
name: 'Sports Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '01854d65-636e-476b-9bbd-881c1834cdb0',
|
||||
name: 'Political Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '01854d65-636e-476b-9bbd-881c1834cdb0',
|
||||
name: 'Philosophical Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '004d484a-488e-478e-90f5-b37de3961527',
|
||||
name: 'Contemporary/Urban',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '004d484a-488e-478e-90f5-b37de3961527',
|
||||
name: 'Epic Fantasy',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '004d484a-488e-478e-90f5-b37de3961527',
|
||||
name: 'Fairy Tale',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '004d484a-488e-478e-90f5-b37de3961527',
|
||||
name: 'Dark Fantasy',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11',
|
||||
name: 'Ghost',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11',
|
||||
name: 'Zombie',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11',
|
||||
name: 'Werewolf',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11',
|
||||
name: 'Vampire',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11',
|
||||
name: 'Monster',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11',
|
||||
name: 'Slasher',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11',
|
||||
name: 'Body Horror',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11',
|
||||
name: 'Folk Horror',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11',
|
||||
name: 'Occult',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11',
|
||||
name: 'Found Footage',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11',
|
||||
name: 'Outbreak',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f99f1239-2d6c-45e5-87ef-ea1df6a223dc',
|
||||
name: 'Broadway Adaptations',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f99f1239-2d6c-45e5-87ef-ea1df6a223dc',
|
||||
name: 'Original Movie Musicals',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f99f1239-2d6c-45e5-87ef-ea1df6a223dc',
|
||||
name: 'Jukebox Musicals',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f99f1239-2d6c-45e5-87ef-ea1df6a223dc',
|
||||
name: 'Rock Operas',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f99f1239-2d6c-45e5-87ef-ea1df6a223dc',
|
||||
name: 'Dance Movies',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f99f1239-2d6c-45e5-87ef-ea1df6a223dc',
|
||||
name: 'Concert Films',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '79a15574-5e83-4daf-8fdb-dd2261e12b60',
|
||||
name: 'Historical Romance',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '79a15574-5e83-4daf-8fdb-dd2261e12b60',
|
||||
name: 'Regency Romance',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '79a15574-5e83-4daf-8fdb-dd2261e12b60',
|
||||
name: 'Romantic Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '79a15574-5e83-4daf-8fdb-dd2261e12b60',
|
||||
name: 'Romantic Comedy',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '79a15574-5e83-4daf-8fdb-dd2261e12b60',
|
||||
name: 'Fantasy Romance',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0029a12a-e9b9-421f-90c0-446c61afb4dd',
|
||||
name: 'Space Opera',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0029a12a-e9b9-421f-90c0-446c61afb4dd',
|
||||
name: 'Utopia',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0029a12a-e9b9-421f-90c0-446c61afb4dd',
|
||||
name: 'Dystopia',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0029a12a-e9b9-421f-90c0-446c61afb4dd',
|
||||
name: 'Contemporary Sci-Fi',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0029a12a-e9b9-421f-90c0-446c61afb4dd',
|
||||
name: 'Cyberpunk',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '0029a12a-e9b9-421f-90c0-446c61afb4dd',
|
||||
name: 'Steampunk',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '281857e3-0772-4d7d-b5a8-e460dde75b91',
|
||||
name: 'Psychological',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '281857e3-0772-4d7d-b5a8-e460dde75b91',
|
||||
name: 'Mystery',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '281857e3-0772-4d7d-b5a8-e460dde75b91',
|
||||
name: 'Film Noir',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '281857e3-0772-4d7d-b5a8-e460dde75b91',
|
||||
name: 'Neo-noir',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'ed2515e3-da9a-4291-82bf-4ebe06831407',
|
||||
name: 'Western',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'ed2515e3-da9a-4291-82bf-4ebe06831407',
|
||||
name: 'Classic Western',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'ed2515e3-da9a-4291-82bf-4ebe06831407',
|
||||
name: 'Spaghetti Western',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'ed2515e3-da9a-4291-82bf-4ebe06831407',
|
||||
name: 'Modern Western',
|
||||
},
|
||||
{ genreId: '3676ab4e-1b4f-4568-836a-43f84b1a6228', name: 'Adventure' },
|
||||
{ genreId: '3676ab4e-1b4f-4568-836a-43f84b1a6228', name: 'Disaster' },
|
||||
{ genreId: '3676ab4e-1b4f-4568-836a-43f84b1a6228', name: 'Martial Arts' },
|
||||
{ genreId: '3676ab4e-1b4f-4568-836a-43f84b1a6228', name: 'Military Action' },
|
||||
{ genreId: '3676ab4e-1b4f-4568-836a-43f84b1a6228', name: 'Spy/Espionage' },
|
||||
{ genreId: '3676ab4e-1b4f-4568-836a-43f84b1a6228', name: 'Superhero' },
|
||||
{ genreId: '3676ab4e-1b4f-4568-836a-43f84b1a6228', name: 'Video Game Movies' },
|
||||
{ genreId: '03342d8a-9fa0-4df1-9047-52c226b43b05', name: 'CGI' },
|
||||
{ genreId: '03342d8a-9fa0-4df1-9047-52c226b43b05', name: 'Claymation/Stop Motion' },
|
||||
{ genreId: '03342d8a-9fa0-4df1-9047-52c226b43b05', name: 'Traditional Drawn' },
|
||||
{ genreId: '03342d8a-9fa0-4df1-9047-52c226b43b05', name: 'Cutout Animation' },
|
||||
{ genreId: '03342d8a-9fa0-4df1-9047-52c226b43b05', name: 'Live-Action Hybrid' },
|
||||
{ genreId: '03342d8a-9fa0-4df1-9047-52c226b43b05', name: 'Puppet Animation' },
|
||||
{ genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841', name: 'Black/Dark Comedy' },
|
||||
{ genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841', name: 'Buddy Comedy' },
|
||||
{ genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841', name: 'Hangout Movies' },
|
||||
{ genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841', name: 'Parody/Spoof' },
|
||||
{ genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841', name: 'Prank Movies' },
|
||||
{ genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841', name: 'Satire' },
|
||||
{ genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841', name: 'Slapstick' },
|
||||
{ genreId: 'b7bac6dd-2a86-4191-ac1e-c92be7b8b841', name: 'Screwball' },
|
||||
{ genreId: 'e9e4285c-b6f3-46ef-a991-bd9f1537eae1', name: 'Cop Movies' },
|
||||
{ genreId: 'e9e4285c-b6f3-46ef-a991-bd9f1537eae1', name: 'Crime Drama' },
|
||||
{ genreId: 'e9e4285c-b6f3-46ef-a991-bd9f1537eae1', name: 'Crime Thriller' },
|
||||
{ genreId: 'e9e4285c-b6f3-46ef-a991-bd9f1537eae1', name: 'Detective/Whodunnit' },
|
||||
{ genreId: 'e9e4285c-b6f3-46ef-a991-bd9f1537eae1', name: 'Gangster Films' },
|
||||
{ genreId: 'e9e4285c-b6f3-46ef-a991-bd9f1537eae1', name: 'Hardboiled' },
|
||||
{ genreId: 'e9e4285c-b6f3-46ef-a991-bd9f1537eae1', name: 'Heist/Caper' },
|
||||
{ genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b', name: 'Expository' },
|
||||
{ genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b', name: 'Observational' },
|
||||
{ genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b', name: 'Poetic' },
|
||||
{ genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b', name: 'Participatory' },
|
||||
{ genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b', name: 'Historical' },
|
||||
{ genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b', name: 'Reflexive' },
|
||||
{ genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b', name: 'Nature/Wildlife' },
|
||||
{ genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b', name: 'Social Issue' },
|
||||
{ genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b', name: 'Biographical' },
|
||||
{ genreId: '51e56f26-bbb4-44e8-ac01-d7aa8ef81f3b', name: 'Performative' },
|
||||
{ genreId: '01854d65-636e-476b-9bbd-881c1834cdb0', name: 'Docudrama' },
|
||||
{ genreId: '01854d65-636e-476b-9bbd-881c1834cdb0', name: 'Melodrama' },
|
||||
{ genreId: '01854d65-636e-476b-9bbd-881c1834cdb0', name: 'Teen Drama' },
|
||||
{ genreId: '01854d65-636e-476b-9bbd-881c1834cdb0', name: 'Medical Drama' },
|
||||
{ genreId: '01854d65-636e-476b-9bbd-881c1834cdb0', name: 'Legal Drama' },
|
||||
{ genreId: '01854d65-636e-476b-9bbd-881c1834cdb0', name: 'Religious Drama' },
|
||||
{ genreId: '01854d65-636e-476b-9bbd-881c1834cdb0', name: 'Sports Drama' },
|
||||
{ genreId: '01854d65-636e-476b-9bbd-881c1834cdb0', name: 'Political Drama' },
|
||||
{ genreId: '01854d65-636e-476b-9bbd-881c1834cdb0', name: 'Philosophical Drama' },
|
||||
{ genreId: '004d484a-488e-478e-90f5-b37de3961527', name: 'Contemporary/Urban' },
|
||||
{ genreId: '004d484a-488e-478e-90f5-b37de3961527', name: 'Epic Fantasy' },
|
||||
{ genreId: '004d484a-488e-478e-90f5-b37de3961527', name: 'Fairy Tale' },
|
||||
{ genreId: '004d484a-488e-478e-90f5-b37de3961527', name: 'Dark Fantasy' },
|
||||
{ genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11', name: 'Ghost' },
|
||||
{ genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11', name: 'Zombie' },
|
||||
{ genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11', name: 'Werewolf' },
|
||||
{ genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11', name: 'Vampire' },
|
||||
{ genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11', name: 'Monster' },
|
||||
{ genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11', name: 'Slasher' },
|
||||
{ genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11', name: 'Body Horror' },
|
||||
{ genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11', name: 'Folk Horror' },
|
||||
{ genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11', name: 'Occult' },
|
||||
{ genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11', name: 'Found Footage' },
|
||||
{ genreId: '0bc7d835-ed31-4a6f-a76f-cfe26595eb11', name: 'Outbreak' },
|
||||
{ genreId: 'f99f1239-2d6c-45e5-87ef-ea1df6a223dc', name: 'Broadway Adaptations' },
|
||||
{ genreId: 'f99f1239-2d6c-45e5-87ef-ea1df6a223dc', name: 'Original Movie Musicals' },
|
||||
{ genreId: 'f99f1239-2d6c-45e5-87ef-ea1df6a223dc', name: 'Jukebox Musicals' },
|
||||
{ genreId: 'f99f1239-2d6c-45e5-87ef-ea1df6a223dc', name: 'Rock Operas' },
|
||||
{ genreId: 'f99f1239-2d6c-45e5-87ef-ea1df6a223dc', name: 'Dance Movies' },
|
||||
{ genreId: 'f99f1239-2d6c-45e5-87ef-ea1df6a223dc', name: 'Concert Films' },
|
||||
{ genreId: '79a15574-5e83-4daf-8fdb-dd2261e12b60', name: 'Historical Romance' },
|
||||
{ genreId: '79a15574-5e83-4daf-8fdb-dd2261e12b60', name: 'Regency Romance' },
|
||||
{ genreId: '79a15574-5e83-4daf-8fdb-dd2261e12b60', name: 'Romantic Drama' },
|
||||
{ genreId: '79a15574-5e83-4daf-8fdb-dd2261e12b60', name: 'Romantic Comedy' },
|
||||
{ genreId: '79a15574-5e83-4daf-8fdb-dd2261e12b60', name: 'Fantasy Romance' },
|
||||
{ genreId: '0029a12a-e9b9-421f-90c0-446c61afb4dd', name: 'Space Opera' },
|
||||
{ genreId: '0029a12a-e9b9-421f-90c0-446c61afb4dd', name: 'Utopia' },
|
||||
{ genreId: '0029a12a-e9b9-421f-90c0-446c61afb4dd', name: 'Dystopia' },
|
||||
{ genreId: '0029a12a-e9b9-421f-90c0-446c61afb4dd', name: 'Contemporary Sci-Fi' },
|
||||
{ genreId: '0029a12a-e9b9-421f-90c0-446c61afb4dd', name: 'Cyberpunk' },
|
||||
{ genreId: '0029a12a-e9b9-421f-90c0-446c61afb4dd', name: 'Steampunk' },
|
||||
{ genreId: '281857e3-0772-4d7d-b5a8-e460dde75b91', name: 'Psychological' },
|
||||
{ genreId: '281857e3-0772-4d7d-b5a8-e460dde75b91', name: 'Mystery' },
|
||||
{ genreId: '281857e3-0772-4d7d-b5a8-e460dde75b91', name: 'Film Noir' },
|
||||
{ genreId: '281857e3-0772-4d7d-b5a8-e460dde75b91', name: 'Neo-noir' },
|
||||
{ genreId: 'ed2515e3-da9a-4291-82bf-4ebe06831407', name: 'Western' },
|
||||
{ genreId: 'ed2515e3-da9a-4291-82bf-4ebe06831407', name: 'Classic Western' },
|
||||
{ genreId: 'ed2515e3-da9a-4291-82bf-4ebe06831407', name: 'Spaghetti Western' },
|
||||
{ genreId: 'ed2515e3-da9a-4291-82bf-4ebe06831407', name: 'Modern Western' },
|
||||
];
|
||||
|
||||
await queryRunner.manager.save('subgenres', subgenres);
|
||||
const subgenreValues = subgenres
|
||||
.map((s, i) => `(gen_random_uuid(), $${i * 2 + 1}, $${i * 2 + 2})`)
|
||||
.join(', ');
|
||||
const subgenreParams = subgenres.flatMap((s) => [s.name, s.genreId]);
|
||||
await queryRunner.query(
|
||||
`INSERT INTO "subgenres" ("id", "name", "genre_id") VALUES ${subgenreValues}`,
|
||||
subgenreParams,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.manager.delete('subgenres', {});
|
||||
await queryRunner.query('DELETE FROM "subgenres"');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,16 @@
|
||||
import { In, MigrationInterface, QueryRunner } from 'typeorm';
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class RemoveLastGenresRenameProjectGenres1730340005682
|
||||
implements MigrationInterface
|
||||
{
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
const genresToRemove = [
|
||||
'bfb5f952-8dd9-45f4-bb27-530fa728250c',
|
||||
'8d7262a8-a94b-4f85-886a-a5ecff8844b3',
|
||||
];
|
||||
await queryRunner.query(
|
||||
`DELETE FROM "project_genres" WHERE "genre_id" IN ('bfb5f952-8dd9-45f4-bb27-530fa728250c', '8d7262a8-a94b-4f85-886a-a5ecff8844b3')`,
|
||||
);
|
||||
|
||||
await queryRunner.manager.delete('project_genres', {
|
||||
genre_id: In(genresToRemove),
|
||||
});
|
||||
|
||||
await queryRunner.manager.delete('genres', {
|
||||
id: In(genresToRemove),
|
||||
});
|
||||
await queryRunner.query(
|
||||
`DELETE FROM "genres" WHERE "id" IN ('bfb5f952-8dd9-45f4-bb27-530fa728250c', '8d7262a8-a94b-4f85-886a-a5ecff8844b3')`,
|
||||
);
|
||||
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "project_genres" RENAME TO "project_subgenres"`,
|
||||
|
||||
@@ -1,407 +1,111 @@
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class SeedEpisodicSubgenres1730990068405 implements MigrationInterface {
|
||||
subgenres = [
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2',
|
||||
name: 'Medical Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2',
|
||||
name: 'Legal Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2',
|
||||
name: 'Crime Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2',
|
||||
name: 'Police Procedural',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2',
|
||||
name: 'Courtroom Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2',
|
||||
name: 'Political Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2',
|
||||
name: 'Historical Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2',
|
||||
name: 'Period Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2',
|
||||
name: 'Teen Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2',
|
||||
name: 'Family Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2',
|
||||
name: 'Soap Opera',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2',
|
||||
name: 'Telenovela',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2',
|
||||
name: 'Anthology Drama',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3170f9cc-338a-4478-a14c-39bce63870d0',
|
||||
name: 'Sitcom (Situational Comedy)',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3170f9cc-338a-4478-a14c-39bce63870d0',
|
||||
name: 'Romantic Comedy',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3170f9cc-338a-4478-a14c-39bce63870d0',
|
||||
name: 'Workplace Comedy',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3170f9cc-338a-4478-a14c-39bce63870d0',
|
||||
name: 'Family Sitcom',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3170f9cc-338a-4478-a14c-39bce63870d0',
|
||||
name: 'Dark Comedy',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3170f9cc-338a-4478-a14c-39bce63870d0',
|
||||
name: 'Sketch Comedy',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3170f9cc-338a-4478-a14c-39bce63870d0',
|
||||
name: 'Stand-up Comedy',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '3170f9cc-338a-4478-a14c-39bce63870d0',
|
||||
name: 'Animated Comedy',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '6f1785ef-b59b-4032-acc1-705f0aece2e6',
|
||||
name: 'Spy/Espionage',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '6f1785ef-b59b-4032-acc1-705f0aece2e6',
|
||||
name: 'Superhero',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '6f1785ef-b59b-4032-acc1-705f0aece2e6',
|
||||
name: 'Martial Arts',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '6f1785ef-b59b-4032-acc1-705f0aece2e6',
|
||||
name: 'Military Action',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '932a7b0e-b07b-4829-9e17-36b13805c516',
|
||||
name: 'Space Opera',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '932a7b0e-b07b-4829-9e17-36b13805c516',
|
||||
name: 'Time Travel',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '932a7b0e-b07b-4829-9e17-36b13805c516',
|
||||
name: 'Dystopian/Post-Apocalyptic',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '932a7b0e-b07b-4829-9e17-36b13805c516',
|
||||
name: 'Supernatural',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '932a7b0e-b07b-4829-9e17-36b13805c516',
|
||||
name: 'Urban Fantasy',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '932a7b0e-b07b-4829-9e17-36b13805c516',
|
||||
name: 'High Fantasy',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '88ea9593-12c0-4308-8157-c8ed5cf85568',
|
||||
name: 'Detective Series',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '88ea9593-12c0-4308-8157-c8ed5cf85568',
|
||||
name: 'Psychological Thriller',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '88ea9593-12c0-4308-8157-c8ed5cf85568',
|
||||
name: 'Crime Thriller',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '88ea9593-12c0-4308-8157-c8ed5cf85568',
|
||||
name: 'Supernatural Mystery',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '264f275e-87ec-4f91-9c64-28264d869375',
|
||||
name: 'Supernatural Horror',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '264f275e-87ec-4f91-9c64-28264d869375',
|
||||
name: 'Slasher',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '264f275e-87ec-4f91-9c64-28264d869375',
|
||||
name: 'Psychological Horror',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '264f275e-87ec-4f91-9c64-28264d869375',
|
||||
name: 'Zombie',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4',
|
||||
name: 'Competition Shows',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4',
|
||||
name: 'Talent Shows',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4',
|
||||
name: 'Dating Shows',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4',
|
||||
name: 'Lifestyle',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4',
|
||||
name: 'Home Improvement',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4',
|
||||
name: 'Cooking Shows',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4',
|
||||
name: 'Travel Shows',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4',
|
||||
name: 'Survival Shows',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '57751942-f0ba-499a-b220-7985059bc194',
|
||||
name: 'Adult Animation',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '57751942-f0ba-499a-b220-7985059bc194',
|
||||
name: "Children's Animation",
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '57751942-f0ba-499a-b220-7985059bc194',
|
||||
name: 'Anime',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'e90710dd-cac4-4997-923a-78b19d778876',
|
||||
name: 'Educational',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'e90710dd-cac4-4997-923a-78b19d778876',
|
||||
name: 'Adventure',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'e90710dd-cac4-4997-923a-78b19d778876',
|
||||
name: 'Fantasy',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '62c3e54a-cf91-4a01-9eb3-f6e5ba70b74e',
|
||||
name: 'Late Night Talk Shows',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '62c3e54a-cf91-4a01-9eb3-f6e5ba70b74e',
|
||||
name: 'Daytime Talk Shows',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '62c3e54a-cf91-4a01-9eb3-f6e5ba70b74e',
|
||||
name: 'Sketch Comedy Shows',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '03e341d5-0338-406b-9672-64a06cf2b831',
|
||||
name: 'News Broadcasts',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '03e341d5-0338-406b-9672-64a06cf2b831',
|
||||
name: 'Political Commentary',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '03e341d5-0338-406b-9672-64a06cf2b831',
|
||||
name: 'Investigative Journalism',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '094777d5-5926-43bf-a384-60f800fb6010',
|
||||
name: 'Quiz Shows',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '094777d5-5926-43bf-a384-60f800fb6010',
|
||||
name: 'Panel Shows',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '7e32a2d4-9615-49c0-9238-d10f997c43d5',
|
||||
name: 'Sports Commentary',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'b492be4d-0011-443a-9094-9b927e2650a5',
|
||||
name: 'Music Videos',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'b492be4d-0011-443a-9094-9b927e2650a5',
|
||||
name: 'Concert Broadcasts',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: 'b492be4d-0011-443a-9094-9b927e2650a5',
|
||||
name: 'Music Competition Shows',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86',
|
||||
name: 'True Crime',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86',
|
||||
name: 'Science & Technology',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86',
|
||||
name: 'Travel',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86',
|
||||
name: 'Observational',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86',
|
||||
name: 'Expository',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86',
|
||||
name: 'Performative',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86',
|
||||
name: 'Poetic',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86',
|
||||
name: 'Reflexive',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86',
|
||||
name: 'Historical',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86',
|
||||
name: 'Biographical',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86',
|
||||
name: 'Nature/Wildlife',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86',
|
||||
name: 'Social Issue',
|
||||
},
|
||||
{
|
||||
id: randomUUID(),
|
||||
genreId: '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86',
|
||||
name: 'Docudrama',
|
||||
},
|
||||
];
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.manager.save('subgenres', this.subgenres);
|
||||
await queryRunner.query(`
|
||||
INSERT INTO "subgenres" ("id", "genre_id", "name") VALUES
|
||||
(gen_random_uuid(), 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2', 'Medical Drama'),
|
||||
(gen_random_uuid(), 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2', 'Legal Drama'),
|
||||
(gen_random_uuid(), 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2', 'Crime Drama'),
|
||||
(gen_random_uuid(), 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2', 'Police Procedural'),
|
||||
(gen_random_uuid(), 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2', 'Courtroom Drama'),
|
||||
(gen_random_uuid(), 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2', 'Political Drama'),
|
||||
(gen_random_uuid(), 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2', 'Historical Drama'),
|
||||
(gen_random_uuid(), 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2', 'Period Drama'),
|
||||
(gen_random_uuid(), 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2', 'Teen Drama'),
|
||||
(gen_random_uuid(), 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2', 'Family Drama'),
|
||||
(gen_random_uuid(), 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2', 'Soap Opera'),
|
||||
(gen_random_uuid(), 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2', 'Telenovela'),
|
||||
(gen_random_uuid(), 'f49d5884-842b-4f8e-b64f-c3f9a4e335d2', 'Anthology Drama'),
|
||||
(gen_random_uuid(), '3170f9cc-338a-4478-a14c-39bce63870d0', 'Sitcom (Situational Comedy)'),
|
||||
(gen_random_uuid(), '3170f9cc-338a-4478-a14c-39bce63870d0', 'Romantic Comedy'),
|
||||
(gen_random_uuid(), '3170f9cc-338a-4478-a14c-39bce63870d0', 'Workplace Comedy'),
|
||||
(gen_random_uuid(), '3170f9cc-338a-4478-a14c-39bce63870d0', 'Family Sitcom'),
|
||||
(gen_random_uuid(), '3170f9cc-338a-4478-a14c-39bce63870d0', 'Dark Comedy'),
|
||||
(gen_random_uuid(), '3170f9cc-338a-4478-a14c-39bce63870d0', 'Sketch Comedy'),
|
||||
(gen_random_uuid(), '3170f9cc-338a-4478-a14c-39bce63870d0', 'Stand-up Comedy'),
|
||||
(gen_random_uuid(), '3170f9cc-338a-4478-a14c-39bce63870d0', 'Animated Comedy'),
|
||||
(gen_random_uuid(), '6f1785ef-b59b-4032-acc1-705f0aece2e6', 'Spy/Espionage'),
|
||||
(gen_random_uuid(), '6f1785ef-b59b-4032-acc1-705f0aece2e6', 'Superhero'),
|
||||
(gen_random_uuid(), '6f1785ef-b59b-4032-acc1-705f0aece2e6', 'Martial Arts'),
|
||||
(gen_random_uuid(), '6f1785ef-b59b-4032-acc1-705f0aece2e6', 'Military Action'),
|
||||
(gen_random_uuid(), '932a7b0e-b07b-4829-9e17-36b13805c516', 'Space Opera'),
|
||||
(gen_random_uuid(), '932a7b0e-b07b-4829-9e17-36b13805c516', 'Time Travel'),
|
||||
(gen_random_uuid(), '932a7b0e-b07b-4829-9e17-36b13805c516', 'Dystopian/Post-Apocalyptic'),
|
||||
(gen_random_uuid(), '932a7b0e-b07b-4829-9e17-36b13805c516', 'Supernatural'),
|
||||
(gen_random_uuid(), '932a7b0e-b07b-4829-9e17-36b13805c516', 'Urban Fantasy'),
|
||||
(gen_random_uuid(), '932a7b0e-b07b-4829-9e17-36b13805c516', 'High Fantasy'),
|
||||
(gen_random_uuid(), '88ea9593-12c0-4308-8157-c8ed5cf85568', 'Detective Series'),
|
||||
(gen_random_uuid(), '88ea9593-12c0-4308-8157-c8ed5cf85568', 'Psychological Thriller'),
|
||||
(gen_random_uuid(), '88ea9593-12c0-4308-8157-c8ed5cf85568', 'Crime Thriller'),
|
||||
(gen_random_uuid(), '88ea9593-12c0-4308-8157-c8ed5cf85568', 'Supernatural Mystery'),
|
||||
(gen_random_uuid(), '264f275e-87ec-4f91-9c64-28264d869375', 'Supernatural Horror'),
|
||||
(gen_random_uuid(), '264f275e-87ec-4f91-9c64-28264d869375', 'Slasher'),
|
||||
(gen_random_uuid(), '264f275e-87ec-4f91-9c64-28264d869375', 'Psychological Horror'),
|
||||
(gen_random_uuid(), '264f275e-87ec-4f91-9c64-28264d869375', 'Zombie'),
|
||||
(gen_random_uuid(), 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4', 'Competition Shows'),
|
||||
(gen_random_uuid(), 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4', 'Talent Shows'),
|
||||
(gen_random_uuid(), 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4', 'Dating Shows'),
|
||||
(gen_random_uuid(), 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4', 'Lifestyle'),
|
||||
(gen_random_uuid(), 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4', 'Home Improvement'),
|
||||
(gen_random_uuid(), 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4', 'Cooking Shows'),
|
||||
(gen_random_uuid(), 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4', 'Travel Shows'),
|
||||
(gen_random_uuid(), 'a0bf144a-9bb7-4152-b30f-6d52ad064cf4', 'Survival Shows'),
|
||||
(gen_random_uuid(), '57751942-f0ba-499a-b220-7985059bc194', 'Adult Animation'),
|
||||
(gen_random_uuid(), '57751942-f0ba-499a-b220-7985059bc194', "Children's Animation"),
|
||||
(gen_random_uuid(), '57751942-f0ba-499a-b220-7985059bc194', 'Anime'),
|
||||
(gen_random_uuid(), 'e90710dd-cac4-4997-923a-78b19d778876', 'Educational'),
|
||||
(gen_random_uuid(), 'e90710dd-cac4-4997-923a-78b19d778876', 'Adventure'),
|
||||
(gen_random_uuid(), 'e90710dd-cac4-4997-923a-78b19d778876', 'Fantasy'),
|
||||
(gen_random_uuid(), '62c3e54a-cf91-4a01-9eb3-f6e5ba70b74e', 'Late Night Talk Shows'),
|
||||
(gen_random_uuid(), '62c3e54a-cf91-4a01-9eb3-f6e5ba70b74e', 'Daytime Talk Shows'),
|
||||
(gen_random_uuid(), '62c3e54a-cf91-4a01-9eb3-f6e5ba70b74e', 'Sketch Comedy Shows'),
|
||||
(gen_random_uuid(), '03e341d5-0338-406b-9672-64a06cf2b831', 'News Broadcasts'),
|
||||
(gen_random_uuid(), '03e341d5-0338-406b-9672-64a06cf2b831', 'Political Commentary'),
|
||||
(gen_random_uuid(), '03e341d5-0338-406b-9672-64a06cf2b831', 'Investigative Journalism'),
|
||||
(gen_random_uuid(), '094777d5-5926-43bf-a384-60f800fb6010', 'Quiz Shows'),
|
||||
(gen_random_uuid(), '094777d5-5926-43bf-a384-60f800fb6010', 'Panel Shows'),
|
||||
(gen_random_uuid(), '7e32a2d4-9615-49c0-9238-d10f997c43d5', 'Sports Commentary'),
|
||||
(gen_random_uuid(), 'b492be4d-0011-443a-9094-9b927e2650a5', 'Music Videos'),
|
||||
(gen_random_uuid(), 'b492be4d-0011-443a-9094-9b927e2650a5', 'Concert Broadcasts'),
|
||||
(gen_random_uuid(), 'b492be4d-0011-443a-9094-9b927e2650a5', 'Music Competition Shows'),
|
||||
(gen_random_uuid(), '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86', 'True Crime'),
|
||||
(gen_random_uuid(), '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86', 'Science & Technology'),
|
||||
(gen_random_uuid(), '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86', 'Travel'),
|
||||
(gen_random_uuid(), '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86', 'Observational'),
|
||||
(gen_random_uuid(), '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86', 'Expository'),
|
||||
(gen_random_uuid(), '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86', 'Performative'),
|
||||
(gen_random_uuid(), '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86', 'Poetic'),
|
||||
(gen_random_uuid(), '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86', 'Reflexive'),
|
||||
(gen_random_uuid(), '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86', 'Historical'),
|
||||
(gen_random_uuid(), '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86', 'Biographical'),
|
||||
(gen_random_uuid(), '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86', 'Nature/Wildlife'),
|
||||
(gen_random_uuid(), '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86', 'Social Issue'),
|
||||
(gen_random_uuid(), '5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86', 'Docudrama')
|
||||
ON CONFLICT DO NOTHING
|
||||
`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.manager.query(`
|
||||
DELETE FROM subgenres
|
||||
WHERE id IN (${this.subgenres.map((subgenre) => `'${subgenre.id}'`).join(',')})
|
||||
await queryRunner.query(`
|
||||
DELETE FROM "subgenres"
|
||||
WHERE "genre_id" IN (
|
||||
'f49d5884-842b-4f8e-b64f-c3f9a4e335d2',
|
||||
'3170f9cc-338a-4478-a14c-39bce63870d0',
|
||||
'6f1785ef-b59b-4032-acc1-705f0aece2e6',
|
||||
'932a7b0e-b07b-4829-9e17-36b13805c516',
|
||||
'88ea9593-12c0-4308-8157-c8ed5cf85568',
|
||||
'264f275e-87ec-4f91-9c64-28264d869375',
|
||||
'a0bf144a-9bb7-4152-b30f-6d52ad064cf4',
|
||||
'57751942-f0ba-499a-b220-7985059bc194',
|
||||
'e90710dd-cac4-4997-923a-78b19d778876',
|
||||
'62c3e54a-cf91-4a01-9eb3-f6e5ba70b74e',
|
||||
'03e341d5-0338-406b-9672-64a06cf2b831',
|
||||
'094777d5-5926-43bf-a384-60f800fb6010',
|
||||
'7e32a2d4-9615-49c0-9238-d10f997c43d5',
|
||||
'b492be4d-0011-443a-9094-9b927e2650a5',
|
||||
'5b6ad647-d49b-4d4b-84c9-8b84bb5ebb86'
|
||||
)
|
||||
`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user