adding charges table and starting the endpoint for charging for a grant

This commit is contained in:
Arjun Patel
2019-01-29 10:32:21 -08:00
parent 6ca8807a9b
commit e3b7a1699e
13 changed files with 148 additions and 9 deletions
@@ -0,0 +1,20 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.addColumn('donors', 'stripe_id', {
type: Sequelize.UUID,
defaultValue: null
});
},
down: (queryInterface, Sequelize) => {
/*
Add reverting commands here.
Return a promise to correctly handle asynchronicity.
Example:
return queryInterface.dropTable('users');
*/
}
};
@@ -0,0 +1,33 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('charges', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
amount: {
allowNull: false,
type: Sequelize.INTEGER
},
description: {
type: Sequelize.STRING
},
createdAt: {
allowNull: false,
type: Sequelize.DATE,
defaultValue: new Date()
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE,
defaultValue: new Date()
}
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('charges');
}
};