From 6467ea14b0f07b8e95e4ff5792406124c5f4a40d Mon Sep 17 00:00:00 2001 From: 0x24d Date: Sat, 20 Nov 2021 12:51:05 +0000 Subject: [PATCH] Remove default struct properties and set all unique keys to not null. --- config/sql/channel_continuations.sql | 4 ++-- src/invidious/channels/channels.cr | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/sql/channel_continuations.sql b/config/sql/channel_continuations.sql index 629b2aef..5ac2facf 100644 --- a/config/sql/channel_continuations.sql +++ b/config/sql/channel_continuations.sql @@ -5,8 +5,8 @@ CREATE TABLE IF NOT EXISTS public.channel_continuations ( id text NOT NULL, - page integer, - sort_by text, + page integer NOT NULL, + sort_by text NOT NULL, continuation text, CONSTRAINT channel_continuations_id_page_sort_by_key UNIQUE (id, page, sort_by) ); diff --git a/src/invidious/channels/channels.cr b/src/invidious/channels/channels.cr index 37868475..a27829db 100644 --- a/src/invidious/channels/channels.cr +++ b/src/invidious/channels/channels.cr @@ -12,8 +12,8 @@ struct ChannelContinuation include DB::Serializable property id : String - property page : Int32 = 0 - property sort_by : String = "newest" + property page : Int32 + property sort_by : String property continuation : String def to_tuple