Skip to content

Commit 7f6e55e

Browse files
committed
use DB uuid type for entity uuids: migration and framefield type
1 parent 2d642f0 commit 7f6e55e

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

lib/model/frames/entity.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Entity extends Frame.define(
2424
embedded('creator'),
2525
embedded('currentVersion'),
2626
fieldTypes([
27-
'int4', 'varchar',
27+
'int4', 'uuid',
2828
'int4', 'int4',
2929
'conflictType',
3030
'timestamptz',
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-- Copyright 2025 ODK Central Developers
2+
-- See the NOTICE file at the top-level directory of this distribution and at
3+
-- https://github.com/getodk/central-backend/blob/master/NOTICE.
4+
-- This file is part of ODK Central. It is subject to the license terms in
5+
-- the LICENSE file found in the top-level directory of this distribution and at
6+
-- https://www.apache.org/licenses/LICENSE-2.0. No part of ODK Central,
7+
-- including this file, may be copied, modified, propagated, or distributed
8+
-- except according to the terms contained in the LICENSE file.
9+
10+
ALTER TABLE entities
11+
ALTER COLUMN "uuid" TYPE varchar(255);
12+
13+
ALTER TABLE purged_entities
14+
ALTER COLUMN "entityUuid" TYPE varchar(255);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- Copyright 2025 ODK Central Developers
2+
-- See the NOTICE file at the top-level directory of this distribution and at
3+
-- https://github.com/getodk/central-backend/blob/master/NOTICE.
4+
-- This file is part of ODK Central. It is subject to the license terms in
5+
-- the LICENSE file found in the top-level directory of this distribution and at
6+
-- https://www.apache.org/licenses/LICENSE-2.0. No part of ODK Central,
7+
-- including this file, may be copied, modified, propagated, or distributed
8+
-- except according to the terms contained in the LICENSE file.
9+
10+
ALTER TABLE entities
11+
ALTER COLUMN "uuid" TYPE uuid
12+
USING "uuid"::uuid;
13+
14+
ALTER TABLE purged_entities
15+
ALTER COLUMN "entityUuid" TYPE uuid
16+
USING "entityUuid"::uuid;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright 2025 ODK Central Developers
2+
// See the NOTICE file at the top-level directory of this distribution and at
3+
// https://github.com/getodk/central-backend/blob/master/NOTICE.
4+
// This file is part of ODK Central. It is subject to the license terms in
5+
// the LICENSE file found in the top-level directory of this distribution and at
6+
// https://www.apache.org/licenses/LICENSE-2.0. No part of ODK Central,
7+
// including this file, may be copied, modified, propagated, or distributed
8+
// except according to the terms contained in the LICENSE file.
9+
10+
module.exports = require('../pure-sql-migration')(__filename);

0 commit comments

Comments
 (0)