From 10d8a4b3ca96398e5d2586ef6bed16b605ccb09a Mon Sep 17 00:00:00 2001 From: broquemonsieur Date: Fri, 29 Dec 2023 04:53:28 -0800 Subject: [PATCH] Add new migration --- .../0012_create_compilation_videos_table.cr | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/invidious/database/migrations/0012_create_compilation_videos_table.cr diff --git a/src/invidious/database/migrations/0012_create_compilation_videos_table.cr b/src/invidious/database/migrations/0012_create_compilation_videos_table.cr new file mode 100644 index 00000000..6d891066 --- /dev/null +++ b/src/invidious/database/migrations/0012_create_compilation_videos_table.cr @@ -0,0 +1,30 @@ +module Invidious::Database::Migrations + class CreateCompilationVideosTable < Migration + version 12 + + def up(conn : DB::Connection) + conn.exec <<-SQL + CREATE TABLE IF NOT EXISTS public.compilation_videos + ( + title text, + id text, + author text, + ucid text, + length_seconds integer, + starting_timestamp_seconds integer, + ending_timestamp_seconds integer, + published timestamptz, + compid text references compilations(id), + index int8, + order_index integer, + PRIMARY KEY (index,compid) + ); + SQL + + conn.exec <<-SQL + GRANT ALL ON TABLE public.playlist_videos TO current_user; + SQL + end + end + end + \ No newline at end of file