model set up and associations
This commit is contained in:
@@ -16,7 +16,9 @@ module.exports = (sequelize, DataTypes) => {
|
||||
},
|
||||
email: {
|
||||
type: DataTypes.STRING,
|
||||
isEmail: true,
|
||||
validate: {
|
||||
isEmail: true
|
||||
},
|
||||
allowNull: false
|
||||
},
|
||||
password: {
|
||||
|
||||
@@ -18,9 +18,18 @@ module.exports = (sequelize, DataTypes) => {
|
||||
allowNull: false,
|
||||
default: new Date()
|
||||
},
|
||||
monthly: DataTypes.BOOLEAN,
|
||||
num_causes: DataTypes.INTEGER,
|
||||
num_regions: DataTypes.INTEGER
|
||||
monthly: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false
|
||||
},
|
||||
num_causes: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false
|
||||
},
|
||||
num_regions: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false
|
||||
}
|
||||
});
|
||||
return Grants;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
module.exports = (sequelize, DataTypes) => {
|
||||
const Organizations = sequelize.define('organizations', {
|
||||
id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true
|
||||
},
|
||||
name: { type: DataTypes.STRING, allowNull: false },
|
||||
short_description: DataTypes.STRING,
|
||||
primary_cause: { type: DataTypes.STRING, allowNull: false },
|
||||
primary_region: { type: DataTypes.STRING, allowNull: false }
|
||||
});
|
||||
return Organizations;
|
||||
};
|
||||
Reference in New Issue
Block a user