-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added sqlite db and migrated tables
- Loading branch information
1 parent
bdbe84e
commit bac2adc
Showing
20 changed files
with
326 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
'use strict'; | ||
module.exports = { | ||
up: async (queryInterface, Sequelize) => { | ||
await queryInterface.createTable('Qualifications', { | ||
id: { | ||
allowNull: false, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
type: Sequelize.INTEGER | ||
}, | ||
projectId: { | ||
type: Sequelize.NUMBER | ||
}, | ||
type: { | ||
type: Sequelize.STRING | ||
}, | ||
label: { | ||
type: Sequelize.STRING | ||
}, | ||
creditingPeriodStartDate: { | ||
type: Sequelize.DATE | ||
}, | ||
creditingPeriodEndDate: { | ||
type: Sequelize.DATE | ||
}, | ||
owner: { | ||
type: Sequelize.STRING | ||
}, | ||
unitId: { | ||
type: Sequelize.NUMBER | ||
}, | ||
createdAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE | ||
}, | ||
updatedAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE | ||
} | ||
}); | ||
}, | ||
down: async (queryInterface, Sequelize) => { | ||
await queryInterface.dropTable('Qualifications'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
'use strict'; | ||
module.exports = { | ||
up: async (queryInterface, Sequelize) => { | ||
await queryInterface.createTable('CoBenefits', { | ||
id: { | ||
allowNull: false, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
type: Sequelize.INTEGER | ||
}, | ||
benfit: { | ||
type: Sequelize.STRING | ||
}, | ||
owner: { | ||
type: Sequelize.STRING | ||
}, | ||
projectId: { | ||
type: Sequelize.NUMBER | ||
}, | ||
createdAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE | ||
}, | ||
updatedAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE | ||
} | ||
}); | ||
}, | ||
down: async (queryInterface, Sequelize) => { | ||
await queryInterface.dropTable('CoBenefits'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
'use strict'; | ||
module.exports = { | ||
up: async (queryInterface, Sequelize) => { | ||
await queryInterface.createTable('Projects', { | ||
id: { | ||
allowNull: false, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
type: Sequelize.INTEGER | ||
}, | ||
currentRegistry: { | ||
type: Sequelize.STRING | ||
}, | ||
registryOfOrigin: { | ||
type: Sequelize.STRING | ||
}, | ||
originProjectId: { | ||
type: Sequelize.NUMBER | ||
}, | ||
program: { | ||
type: Sequelize.STRING | ||
}, | ||
warehouseProjectId: { | ||
type: Sequelize.NUMBER | ||
}, | ||
projectName: { | ||
type: Sequelize.STRING | ||
}, | ||
projectLink: { | ||
type: Sequelize.STRING | ||
}, | ||
projectDeveloper: { | ||
type: Sequelize.STRING | ||
}, | ||
sector: { | ||
type: Sequelize.STRING | ||
}, | ||
projectType: { | ||
type: Sequelize.STRING | ||
}, | ||
coveredByNDC: { | ||
type: Sequelize.STRING | ||
}, | ||
NDCLinkage: { | ||
type: Sequelize.STRING | ||
}, | ||
projectStatus: { | ||
type: Sequelize.STRING | ||
}, | ||
projectStatusDate: { | ||
type: Sequelize.DATE | ||
}, | ||
unitMetric: { | ||
type: Sequelize.STRING | ||
}, | ||
methodology: { | ||
type: Sequelize.STRING | ||
}, | ||
methodologyVersion: { | ||
type: Sequelize.STRING | ||
}, | ||
validationApproach: { | ||
type: Sequelize.STRING | ||
}, | ||
validationDate: { | ||
type: Sequelize.DATE | ||
}, | ||
projectTag: { | ||
type: Sequelize.STRING | ||
}, | ||
estimatedAnnualAverageEmmisionReduction: { | ||
type: Sequelize.STRING | ||
}, | ||
owner: { | ||
type: Sequelize.STRING | ||
}, | ||
createdAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE | ||
}, | ||
updatedAt: { | ||
allowNull: false, | ||
type: Sequelize.DATE | ||
} | ||
}); | ||
}, | ||
down: async (queryInterface, Sequelize) => { | ||
await queryInterface.dropTable('Projects'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict'; | ||
const { | ||
Model | ||
} = require('sequelize'); | ||
module.exports = (sequelize, DataTypes) => { | ||
class CoBenefit extends Model { | ||
/** | ||
* Helper method for defining associations. | ||
* This method is not a part of Sequelize lifecycle. | ||
* The `models/index` file will call this method automatically. | ||
*/ | ||
static associate(models) { | ||
// define association here | ||
} | ||
}; | ||
CoBenefit.init({ | ||
benfit: DataTypes.STRING, | ||
owner: DataTypes.STRING, | ||
projectId: DataTypes.NUMBER | ||
}, { | ||
sequelize, | ||
modelName: 'CoBenefit', | ||
}); | ||
return CoBenefit; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
'use strict'; | ||
const { | ||
Model | ||
} = require('sequelize'); | ||
module.exports = (sequelize, DataTypes) => { | ||
class Project extends Model { | ||
/** | ||
* Helper method for defining associations. | ||
* This method is not a part of Sequelize lifecycle. | ||
* The `models/index` file will call this method automatically. | ||
*/ | ||
static associate(models) { | ||
// define association here | ||
} | ||
}; | ||
Project.init({ | ||
currentRegistry: DataTypes.STRING, | ||
registryOfOrigin: DataTypes.STRING, | ||
originProjectId: DataTypes.NUMBER, | ||
program: DataTypes.STRING, | ||
warehouseProjectId: DataTypes.NUMBER, | ||
projectName: DataTypes.STRING, | ||
projectLink: DataTypes.STRING, | ||
projectDeveloper: DataTypes.STRING, | ||
sector: DataTypes.STRING, | ||
projectType: DataTypes.STRING, | ||
coveredByNDC: DataTypes.STRING, | ||
NDCLinkage: DataTypes.STRING, | ||
projectStatus: DataTypes.STRING, | ||
projectStatusDate: DataTypes.DATE, | ||
unitMetric: DataTypes.STRING, | ||
methodology: DataTypes.STRING, | ||
methodologyVersion: DataTypes.STRING, | ||
validationApproach: DataTypes.STRING, | ||
validationDate: DataTypes.DATE, | ||
projectTag: DataTypes.STRING, | ||
estimatedAnnualAverageEmmisionReduction: DataTypes.STRING, | ||
owner: DataTypes.STRING | ||
}, { | ||
sequelize, | ||
modelName: 'Project', | ||
}); | ||
return Project; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.