Skip to content

Commit

Permalink
Merge pull request #2657 from newjersey/njwe-2292/etpl-data-2024-07-12
Browse files Browse the repository at this point in the history
[NJWE-2292] etpl data 2024-07-12
  • Loading branch information
ChelseaKR authored Jul 12, 2024
2 parents a4b7714 + 570fc19 commit 3f5fe76
Show file tree
Hide file tree
Showing 7 changed files with 447,168 additions and 14,707 deletions.
27,978 changes: 13,274 additions & 14,704 deletions backend/data/standardized_etpl.csv

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions backend/migrations/20240712213046-update-etpl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
'use strict';

var dbm;
var type;
var seed;
var fs = require('fs');
var path = require('path');
var 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) {
dbm = options.dbmigrate;
type = dbm.dataType;
seed = seedLink;
Promise = options.Promise;
};

exports.up = function(db) {
const fileName =
process.env.NODE_ENV === "test"
? "20240712213046-update-etpl-up-TEST.sql"
: "20240712213046-update-etpl-up.sql";
var filePath = path.join(__dirname, 'sqls', fileName);
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 fileName =
process.env.NODE_ENV === "test"
? "20240712213046-update-etpl-down-TEST.sql"
: "20240712213046-update-etpl-down.sql";
var filePath = path.join(__dirname, 'sqls', fileName);
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 @@
-- intentionally left blank
Loading

0 comments on commit 3f5fe76

Please sign in to comment.