Skip to content

Commit

Permalink
Merge pull request #540 from Open-Earth-Foundation/fix/emissions-fact…
Browse files Browse the repository at this point in the history
…or-seed

fix(seed): emissions factor seed script and files
  • Loading branch information
lemilonkh authored Jul 17, 2024
2 parents 5fcb77e + 93cb557 commit 3196807
Show file tree
Hide file tree
Showing 12 changed files with 63,147 additions and 103,840 deletions.
22 changes: 22 additions & 0 deletions app/migrations/20240627123051-EmissionsFactor-add-columns.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';

const columns = ["actor_id", "methodology_name"];

/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
return queryInterface.sequelize.transaction(async (transaction) => {
for (const column of columns) {
await queryInterface.addColumn("EmissionsFactor", column, Sequelize.TEXT, { transaction });
}
});
},

async down(queryInterface) {
return queryInterface.sequelize.transaction(async (transaction) => {
for (const column of columns) {
await queryInterface.removeColumn("EmissionsFactor", column, { transaction });
}
});
}
};
6 changes: 3 additions & 3 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"build-storybook": "storybook build",
"db:migrate": "sequelize-cli db:migrate",
"db:migrate:undo": "sequelize-cli db:migrate:undo",
"db:seed": "sequelize-cli db:seed:all",
"db:seed:undo": "sequelize-cli db:seed:undo",
"db:seed:undo:all": "sequelize-cli db:seed:undo:all",
"db:seed": "sequelize-cli db:seed:all --debug",
"db:seed:undo": "sequelize-cli db:seed:undo --debug",
"db:seed:undo:all": "sequelize-cli db:seed:undo:all --debug",
"db:gen-migration": "sequelize-cli migration:generate --name",
"db:gen-seed": "sequelize-cli seed:generate --name",
"sync-catalogue": "tsx scripts/catalogue-sync.ts",
Expand Down
104,564 changes: 52,282 additions & 52,282 deletions app/seed-data/emissions_factors/data_processed/CarbonFootPrint_2023/EmissionsFactor.csv

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 3196807

Please sign in to comment.