Skip to content

Commit

Permalink
feat: create staging resource
Browse files Browse the repository at this point in the history
  • Loading branch information
frantzarty committed Dec 7, 2021
1 parent 188be5b commit 19d5575
Show file tree
Hide file tree
Showing 16 changed files with 509 additions and 15,014 deletions.
47 changes: 25 additions & 22 deletions migrations/20211201194652-create-unit.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,67 +6,70 @@ module.exports = {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
type: Sequelize.INTEGER,
},
uuid: {
type: Sequelize.STRING,
},
owner: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
buyer: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
registry: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
blockIdentifier: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
identifier: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
qualificationId: {
type: Sequelize.NUMBER
type: Sequelize.NUMBER,
},
unitType: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
unitCount: {
type: Sequelize.NUMBER
type: Sequelize.NUMBER,
},
unitStatus: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
unitStatusDate: {
type: Sequelize.DATE
type: Sequelize.DATE,
},
transactionType: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
unitIssuanceLocation: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
unitLink: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
correspondingAdjustment: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
unitTag: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
vintageId: {
type: Sequelize.NUMBER
type: Sequelize.NUMBER,
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
type: Sequelize.DATE,
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
type: Sequelize.DATE,
},
});
},
down: async (queryInterface, Sequelize) => {
await queryInterface.dropTable('Units');
}
};
},
};
59 changes: 31 additions & 28 deletions migrations/20211201195550-create-project.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,85 +6,88 @@ module.exports = {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
type: Sequelize.INTEGER,
},
uuid: {
type: Sequelize.STRING,
},
currentRegistry: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
registryOfOrigin: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
originProjectId: {
type: Sequelize.NUMBER
type: Sequelize.NUMBER,
},
program: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
warehouseProjectId: {
type: Sequelize.NUMBER
type: Sequelize.NUMBER,
},
projectName: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
projectLink: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
projectDeveloper: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
sector: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
projectType: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
coveredByNDC: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
NDCLinkage: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
projectStatus: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
projectStatusDate: {
type: Sequelize.DATE
type: Sequelize.DATE,
},
unitMetric: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
methodology: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
methodologyVersion: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
validationApproach: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
validationDate: {
type: Sequelize.DATE
type: Sequelize.DATE,
},
projectTag: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
estimatedAnnualAverageEmmisionReduction: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
owner: {
type: Sequelize.STRING
type: Sequelize.STRING,
},
createdAt: {
allowNull: false,
type: Sequelize.DATE
type: Sequelize.DATE,
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
type: Sequelize.DATE,
},
});
},
down: async (queryInterface, Sequelize) => {
await queryInterface.dropTable('Projects');
}
};
},
};
30 changes: 30 additions & 0 deletions migrations/20211207145446-staging.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict';

module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable('Staging', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER,
},
uuid: {
type: Sequelize.STRING,
},
table: {
type: Sequelize.STRING,
},
action: {
type: Sequelize.STRING,
},
data: {
type: Sequelize.STRING,
},
});
},

down: async (queryInterface, Sequelize) => {
await queryInterface.dropTable('Staging');
},
};
Loading

0 comments on commit 19d5575

Please sign in to comment.