Add has_been_merged to DB
This commit is contained in:
parent
de143f9033
commit
12aa457e3a
6 changed files with 28 additions and 6 deletions
|
|
@ -0,0 +1,13 @@
|
|||
ALTER TABLE documents ADD COLUMN has_been_merged BOOLEAN NOT NULL DEFAULT False;
|
||||
|
||||
DROP VIEW latest_document_versions;
|
||||
|
||||
CREATE VIEW IF NOT EXISTS latest_document_versions AS --recreate view as it now includes one more field
|
||||
SELECT d.*
|
||||
FROM documents d
|
||||
INNER JOIN (
|
||||
SELECT MAX(vault_update_id) AS max_version_id
|
||||
FROM documents
|
||||
GROUP BY document_id
|
||||
) max_versions
|
||||
ON d.vault_update_id = max_versions.max_version_id;
|
||||
|
|
@ -20,6 +20,8 @@ pub struct StoredDocumentVersion {
|
|||
pub is_deleted: bool,
|
||||
pub user_id: UserId,
|
||||
pub device_id: DeviceId,
|
||||
#[allow(dead_code)] // This is for manual analysis
|
||||
pub has_been_merged: bool,
|
||||
}
|
||||
|
||||
impl PartialEq<Self> for StoredDocumentVersion {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue