nullable read_comments_amount

This commit is contained in:
Dull Bananas 2024-04-01 21:26:05 +00:00
commit 54faf78729
3 changed files with 4 additions and 5 deletions

View file

@ -18,13 +18,13 @@ impl PersonPostAggregates {
fn as_select_unwrap() -> (
post_actions::person_id,
post_actions::post_id,
post_actions::read_comments_amount,
dsl::AssumeNotNull<post_actions::read_comments_amount>,
dsl::AssumeNotNull<post_actions::read_comments>,
) {
(
post_actions::person_id,
post_actions::post_id,
post_actions::read_comments_amount,
post_actions::read_comments_amount.assume_not_null(),
post_actions::read_comments.assume_not_null(),
)
}

View file

@ -690,7 +690,7 @@ diesel::table! {
person_id -> Int4,
read -> Nullable<Timestamptz>,
read_comments -> Nullable<Timestamptz>,
read_comments_amount -> Int8,
read_comments_amount -> Nullable<Int8>,
saved -> Nullable<Timestamptz>,
liked -> Nullable<Timestamptz>,
like_score -> Nullable<Int2>,

View file

@ -166,8 +166,7 @@ ALTER TABLE post_actions
ALTER COLUMN read DROP NOT NULL,
ALTER COLUMN read DROP DEFAULT,
ADD COLUMN read_comments timestamptz,
-- TODO make nullable
ADD COLUMN read_comments_amount bigint NOT NULL,
ADD COLUMN read_comments_amount bigint,
ADD COLUMN saved timestamptz,
ADD COLUMN liked timestamptz,
ADD COLUMN like_score smallint,