-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
147dbe8
commit d5c1493
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
packages/database/src/migrations/20240918030717-AddPacMOSSIentities-modifies-schema.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.