mirror of
https://github.com/wassname/HackFlowy.git
synced 2026-06-27 16:00:04 +08:00
Add defaults to model
This commit is contained in:
+4
-3
@@ -5,10 +5,11 @@ module.exports = {
|
||||
task = orm.define('Tasks', {
|
||||
id : {type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true},
|
||||
content : {type: Sequelize.TEXT, allowNull: false},
|
||||
parent : Sequelize.INTEGER,
|
||||
isCompleted: Sequelize.BOOLEAN,
|
||||
parentId : {type: Sequelize.INTEGER, defaultValue: 0},
|
||||
isCompleted: {type: Sequelize.BOOLEAN, defaultValue: false},
|
||||
priority : {type: Sequelize.INTEGER, defaultValue: 0},
|
||||
createdAt : Sequelize.DATE,
|
||||
updatedAt : Sequelize.DATE
|
||||
updatedAt : Sequelize.DATE,
|
||||
});
|
||||
|
||||
orm.sync();
|
||||
|
||||
@@ -7,7 +7,7 @@ Tasks.destroy({where: {}}).then(function() {
|
||||
{content: 'Welcome to HackFlowy!', isCompleted: false},
|
||||
{content: 'An open-source WorkFlowy clone', isCompleted: false},
|
||||
{content: 'Built using Backbone + Socket.IO', isCompleted: false},
|
||||
{content: 'I pulled this together in a few hours to learn Backbone', isCompleted: false},
|
||||
{content: 'Desyncr pulled this together in a few hours to learn Backbone', isCompleted: false},
|
||||
{content: 'Feel free to try it out and hack on it', isCompleted: false},
|
||||
{content: 'Good Luck!', isCompleted: false}
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user