Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quarterly returns to return versions table #2653

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
'use strict'

const fs = require('fs')
const path = require('path')
let Promise

/**
* We receive the dbmigrate dependency from dbmigrate initially.
* This enables us to not have to rely on NODE_PATH.
*/
exports.setup = function (options, _seedLink) {
Promise = options.Promise
}

exports.up = function (db) {
const filePath = path.join(__dirname, 'sqls', '20241107093135-add-quarterly-returns-to-return-versions-up.sql')
return new Promise(function (resolve, reject) {
fs.readFile(filePath, { encoding: 'utf-8' }, function (err, data) {
if (err) return reject(err)
console.log('received data: ' + data)

resolve(data)
})
})
.then(function (data) {
return db.runSql(data)
})
}

exports.down = function (db) {
const filePath = path.join(__dirname, 'sqls', '20241107093135-add-quarterly-returns-to-return-versions-down.sql')
return new Promise(function (resolve, reject) {
fs.readFile(filePath, { encoding: 'utf-8' }, function (err, data) {
if (err) return reject(err)
console.log('received data: ' + data)

resolve(data)
})
})
.then(function (data) {
return db.runSql(data)
})
}

exports._meta = {
version: 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table water.return_versions
drop column quarterly_returns;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table water.return_versions
add column quarterly_returns boolean default false;
Loading