-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #605 from setlife-network/release/1.3
Release/1.3
- Loading branch information
Showing
73 changed files
with
18,190 additions
and
17,157 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
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,44 @@ | ||
module.exports = { | ||
up: async (queryInterface, Sequelize) => { | ||
return queryInterface.createTable('Contributions', { | ||
id: { | ||
type: Sequelize.DataTypes.INTEGER, | ||
primaryKey: true, | ||
autoIncrement: true, | ||
allowNull: false | ||
}, | ||
contributor_id: { | ||
type: Sequelize.DataTypes.INTEGER, | ||
allowNull: false, | ||
references: { | ||
model: 'Contributors', | ||
key: 'id' | ||
} | ||
}, | ||
issue_id: { | ||
type: Sequelize.DataTypes.INTEGER, | ||
allowNull: false, | ||
references: { | ||
model: 'Issues', | ||
key: 'id' | ||
} | ||
}, | ||
is_author: { | ||
type: Sequelize.DataTypes.INTEGER, | ||
allowNull: false | ||
}, | ||
is_assigned: { | ||
type: Sequelize.DataTypes.INTEGER, | ||
allowNull: false | ||
}, | ||
date_contributed: { | ||
type: Sequelize.DataTypes.DATE, | ||
allowNull: false | ||
}, | ||
}); | ||
}, | ||
|
||
down: async (queryInterface, Sequelize) => { | ||
return queryInterface.dropTable('Contributions'); | ||
} | ||
}; |
21 changes: 21 additions & 0 deletions
21
api/migrations/20220107192315-addConstraintToClientEmail.js
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,21 @@ | ||
module.exports = { | ||
up: async (queryInterface, Sequelize) => { | ||
return queryInterface.sequelize.transaction(t => { | ||
return Promise.all([ | ||
queryInterface.addConstraint('Clients', { | ||
fields: ['email'], | ||
type: 'unique', | ||
name: 'unique_client_email' | ||
}, { transaction: t }) | ||
]) | ||
}) | ||
}, | ||
|
||
down: async (queryInterface, Sequelize) => { | ||
return queryInterface.sequelize.transaction(t => { | ||
return Promise.all([ | ||
queryInterface.removeConstraint('Clients', 'unique_client_email', { transaction: t }) | ||
]) | ||
}) | ||
} | ||
}; |
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,55 @@ | ||
const Sequelize = require('sequelize') | ||
const { DataTypes } = require('sequelize') | ||
|
||
module.exports = (sequelize) => { | ||
|
||
class Contribution extends Sequelize.Model {} | ||
|
||
Contribution.init({ | ||
// Model attributes are defined here | ||
id: { | ||
type: DataTypes.INTEGER, | ||
primaryKey: true, | ||
autoIncrement: true, | ||
allowNull: false | ||
}, | ||
contributor_id: { | ||
type: DataTypes.INTEGER, | ||
allowNull: false, | ||
references: { | ||
model: 'Contributors', | ||
key: 'id' | ||
} | ||
}, | ||
issue_id: { | ||
type: DataTypes.INTEGER, | ||
allowNull: false, | ||
references: { | ||
model: 'Issues', | ||
key: 'id' | ||
} | ||
}, | ||
is_author: { | ||
type: DataTypes.INTEGER, | ||
allowNull: false | ||
}, | ||
is_assigned: { | ||
type: DataTypes.INTEGER, | ||
allowNull: false | ||
}, | ||
date_contributed: { | ||
type: DataTypes.DATE, | ||
allowNull: false | ||
} | ||
}, | ||
{ | ||
// Model options go here | ||
sequelize, | ||
modelName: 'Contribution', | ||
createdAt: 'created_at', | ||
updatedAt: 'updated_at' | ||
}) | ||
|
||
return Contribution | ||
|
||
} |
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
Oops, something went wrong.