Skip to content

Commit

Permalink
etpl data 2025-01-17
Browse files Browse the repository at this point in the history
  • Loading branch information
ChelseaKR committed Jan 17, 2025
1 parent c281edb commit 44cc304
Show file tree
Hide file tree
Showing 6 changed files with 453,875 additions and 7,100 deletions.
14,318 changes: 7,218 additions & 7,100 deletions backend/data/standardized_etpl.csv

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions backend/migrations/20250117201349-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"
? "20250117201349-update-etpl-up-TEST.sql"
: "20250117201349-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"
? "20250117201349-update-etpl-down-TEST.sql"
: "20250117201349-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 44cc304

Please sign in to comment.