feat(db): Add migration & fields to indicate a thread is closed
This commit is contained in:
parent
33462c01fa
commit
468af132e8
4 changed files with 4 additions and 0 deletions
1
migrations/2018-05-25-160648_add_closed_column/down.sql
Normal file
1
migrations/2018-05-25-160648_add_closed_column/down.sql
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE threads DROP COLUMN closed;
|
1
migrations/2018-05-25-160648_add_closed_column/up.sql
Normal file
1
migrations/2018-05-25-160648_add_closed_column/up.sql
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ALTER TABLE threads ADD COLUMN closed BOOLEAN NOT NULL DEFAULT false;
|
|
@ -39,6 +39,7 @@ pub struct Thread {
|
||||||
pub posted: DateTime<Utc>,
|
pub posted: DateTime<Utc>,
|
||||||
pub sticky: bool,
|
pub sticky: bool,
|
||||||
pub user_id: i32,
|
pub user_id: i32,
|
||||||
|
pub closed: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Identifiable, Queryable, Serialize, Associations)]
|
#[derive(Identifiable, Queryable, Serialize, Associations)]
|
||||||
|
|
|
@ -33,6 +33,7 @@ table! {
|
||||||
posted -> Timestamptz,
|
posted -> Timestamptz,
|
||||||
sticky -> Bool,
|
sticky -> Bool,
|
||||||
user_id -> Int4,
|
user_id -> Int4,
|
||||||
|
closed -> Bool,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue