Drop timestamp column from votes (ref #5016)

This commit is contained in:
Felix Ableitner 2024-10-17 11:17:50 +02:00
parent 859dfb3f81
commit 63a2f7b7e3
8 changed files with 4 additions and 7 deletions

View file

@ -300,7 +300,6 @@ mod tests {
comment_id: inserted_comment.id, comment_id: inserted_comment.id,
post_id: inserted_post.id, post_id: inserted_post.id,
person_id: inserted_person.id, person_id: inserted_person.id,
published: inserted_comment_like.published,
score: 1, score: 1,
}; };

View file

@ -500,7 +500,6 @@ mod tests {
let expected_post_like = PostLike { let expected_post_like = PostLike {
post_id: inserted_post.id, post_id: inserted_post.id,
person_id: inserted_person.id, person_id: inserted_person.id,
published: inserted_post_like.published,
score: 1, score: 1,
}; };

View file

@ -125,7 +125,6 @@ diesel::table! {
comment_id -> Int4, comment_id -> Int4,
post_id -> Int4, post_id -> Int4,
score -> Int2, score -> Int2,
published -> Timestamptz,
} }
} }
@ -816,7 +815,6 @@ diesel::table! {
post_id -> Int4, post_id -> Int4,
person_id -> Int4, person_id -> Int4,
score -> Int2, score -> Int2,
published -> Timestamptz,
} }
} }

View file

@ -104,7 +104,6 @@ pub struct CommentLike {
pub comment_id: CommentId, pub comment_id: CommentId,
pub post_id: PostId, // TODO this is redundant pub post_id: PostId, // TODO this is redundant
pub score: i16, pub score: i16,
pub published: DateTime<Utc>,
} }
#[derive(Clone)] #[derive(Clone)]

View file

@ -150,7 +150,6 @@ pub struct PostLike {
pub post_id: PostId, pub post_id: PostId,
pub person_id: PersonId, pub person_id: PersonId,
pub score: i16, pub score: i16,
pub published: DateTime<Utc>,
} }
#[derive(Clone)] #[derive(Clone)]

View file

@ -1125,7 +1125,6 @@ mod tests {
let expected_post_like = PostLike { let expected_post_like = PostLike {
post_id: data.inserted_post.id, post_id: data.inserted_post.id,
person_id: data.local_user_view.person.id, person_id: data.local_user_view.person.id,
published: inserted_post_like.published,
score: 1, score: 1,
}; };
assert_eq!(expected_post_like, inserted_post_like); assert_eq!(expected_post_like, inserted_post_like);

View file

@ -0,0 +1,2 @@
alter table post_like add column published timestamptz not null default now();
alter table comment_like add column published timestamptz not null default now();

View file

@ -0,0 +1,2 @@
alter table post_like drop published;
alter table comment_like drop published;