post creation and adding ribbon functionality

This commit is contained in:
Arjun Patel
2019-04-12 11:51:33 -07:00
parent ee52f38d48
commit a43e1d8dfd
5 changed files with 100 additions and 3 deletions
+28
View File
@@ -0,0 +1,28 @@
const Organization = require('./Organization');
module.exports = (sequelize, DataTypes) => {
const Post = sequelize.define('Post', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
text: {
type: DataTypes.STRING(350),
allowNull: false
},
organization_id: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: Organization(sequelize, DataTypes),
key: 'id'
}
},
num_ribbons: {
type: DataTypes.INTEGER,
defaultValue: 0
}
});
return Post;
};