From e1897704739f3d18b3029afaf454588c5f716557 Mon Sep 17 00:00:00 2001 From: Norbert Maciaszek Date: Mon, 11 Aug 2025 23:55:47 +0200 Subject: [PATCH] Update movies migration: enhance the new movies table schema by adding additional fields such as adult, backdrop_path, genre_ids, original_language, original_title, video, vote_average, and vote_count, and migrate existing data accordingly. --- drizzle/0001_elite_odin.sql | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drizzle/0001_elite_odin.sql b/drizzle/0001_elite_odin.sql index 8c6c131..a3ad041 100644 --- a/drizzle/0001_elite_odin.sql +++ b/drizzle/0001_elite_odin.sql @@ -18,8 +18,25 @@ CREATE TABLE `__new_movies` ( `favorite` integer DEFAULT false ); --> statement-breakpoint -INSERT INTO `__new_movies`("id", "title", "overview", "popularity", "poster_path", "release_date", "seen", "favorite") -SELECT "id", "title", "overview", "popularity", "poster_path", "release_date", "seen", "favorite" FROM `movies`;--> statement-breakpoint +INSERT INTO `__new_movies`("id", "title", "overview", "popularity", "poster_path", "release_date", "seen", "favorite", "adult", "backdrop_path", "genre_ids", "original_language", "original_title", "video", "vote_average", "vote_count") +SELECT + "id", + "title", + "overview", + "popularity", + "poster_path", + "release_date", + "seen", + "favorite", + 0 as "adult", -- wartość domyślna + '' as "backdrop_path", -- wartość domyślna + '[]' as "genre_ids", -- wartość domyślna (pusta tablica JSON) + 'pl-PL' as "original_language", -- wartość domyślna + "title" as "original_title", -- kopiuj z title + 0 as "video", -- wartość domyślna + 0.0 as "vote_average", -- wartość domyślna + 0 as "vote_count" -- wartość domyślna +FROM `movies`;--> statement-breakpoint DROP TABLE `movies`;--> statement-breakpoint ALTER TABLE `__new_movies` RENAME TO `movies`;--> statement-breakpoint PRAGMA foreign_keys=ON; \ No newline at end of file