Skip to content

Commit

Permalink
new entity types
Browse files Browse the repository at this point in the history
  • Loading branch information
hrazasalman committed Sep 18, 2024
1 parent 147dbe8 commit d5c1493
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
'use strict';

import { TupaiaDatabase } from '../TupaiaDatabase';

var dbm;
var type;
var seed;

/**
* We receive the dbmigrate dependency from dbmigrate initially.
* This enables us to not have to rely on NODE_PATH.
*/
exports.setup = function (options, seedLink) {
dbm = options.dbmigrate;
type = dbm.dataType;
seed = seedLink;
};

exports.up = async function () {
const db = new TupaiaDatabase();
await db.executeSql(`ALTER TYPE public.entity_type ADD VALUE IF NOT EXISTS 'pacmossi_district';`);
await db.executeSql(`ALTER TYPE public.entity_type ADD VALUE IF NOT EXISTS 'pacmossi_village';`);
await db.executeSql(
`ALTER TYPE public.entity_type ADD VALUE IF NOT EXISTS 'pacmossi_spraying_site';`,
);
return db.closeConnections();
};

exports.down = function (db) {
return null;
};

exports._meta = {
version: 1,
};
3 changes: 3 additions & 0 deletions packages/types/src/schemas/schemas.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/types/src/types/models.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d5c1493

Please sign in to comment.