Skip to content

Commit

Permalink
Improvements to offline entity backlog processing
Browse files Browse the repository at this point in the history
  • Loading branch information
ktuite committed Aug 20, 2024
1 parent 4d56951 commit e748024
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 139 deletions.
25 changes: 25 additions & 0 deletions lib/model/migrations/20240715-01-backlog-add-event-entityuuid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2024 ODK Central Developers
// See the NOTICE file at the top-level directory of this distribution and at
// https://github.com/getodk/central-backend/blob/master/NOTICE.
// This file is part of ODK Central. It is subject to the license terms in
// the LICENSE file found in the top-level directory of this distribution and at
// https://www.apache.org/licenses/LICENSE-2.0. No part of ODK Central,
// including this file, may be copied, modified, propagated, or distributed
// except according to the terms contained in the LICENSE file.

const up = async (db) => {
await db.raw(`ALTER TABLE entity_submission_backlog
ADD COLUMN "auditId" INT4 NOT NULL,
ADD COLUMN "entityUuid" UUID NOT NULL,
ADD CONSTRAINT fk_audit_id
FOREIGN KEY("auditId")
REFERENCES audits(id)
ON DELETE CASCADE`);
};

const down = (db) => db.raw(`ALTER TABLE entity_submission_backlog
DROP COLUMN "auditId",
DROP COLUMN "entityUuid"
`);

module.exports = { up, down };
Loading

0 comments on commit e748024

Please sign in to comment.