mirror of
https://github.com/wassname/HackFlowy.git
synced 2026-06-27 16:00:04 +08:00
Changed configuration parameters' names to match sequelize nomemclature
Fixed seed/initial_tasks data which created tasks in a non-sequential order (tested on Postgres) Added production-like example configuration
This commit is contained in:
@@ -8,10 +8,10 @@
|
||||
"storage": "db/test.sqlite"
|
||||
},
|
||||
"production": {
|
||||
"username": "root",
|
||||
"password": null,
|
||||
"database": "database_production",
|
||||
"host": "127.0.0.1",
|
||||
"dialect": "mysql"
|
||||
"username": "postgres",
|
||||
"password": "",
|
||||
"database": "hackflowy",
|
||||
"host" : "localhost",
|
||||
"dialect" : "postgres"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"port": 3000,
|
||||
"database": {
|
||||
"username": "postgres",
|
||||
"password": "",
|
||||
"database": "hackflowy",
|
||||
"options" : {
|
||||
"dialect": "postgres",
|
||||
"host" : "localhost",
|
||||
"port" : "5432"
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -3,9 +3,9 @@ var Sequelize = require('sequelize');
|
||||
module.exports = {
|
||||
instance: function(orm) {
|
||||
task = orm.define('Tasks', {
|
||||
id : {type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true},
|
||||
id : {type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true},
|
||||
content : {type: Sequelize.TEXT, allowNull: false},
|
||||
parent : Sequelize.INTEGER,
|
||||
parent : Sequelize.INTEGER,
|
||||
isCompleted: Sequelize.BOOLEAN,
|
||||
createdAt : Sequelize.DATE,
|
||||
updatedAt : Sequelize.DATE
|
||||
|
||||
@@ -2,11 +2,13 @@ var config = require('config'),
|
||||
orm = require('../../orm').configure(config.get('database')),
|
||||
Tasks = require('../../db/models/task').instance(orm);
|
||||
|
||||
Tasks.create({content: 'Welcome to HackFlowy!', isCompleted: false});
|
||||
Tasks.create({content: 'An open-source WorkFlowy clone', isCompleted: false});
|
||||
Tasks.create({content: 'Built using Backbone + Socket.IO', isCompleted: false});
|
||||
Tasks.create({content: 'I pulled this together in a few hours to learn Backbone', isCompleted: false});
|
||||
Tasks.create({content: 'Feel free to try it out and hack on it', isCompleted: false});
|
||||
Tasks.create({content: 'Good Luck!', isCompleted: false});
|
||||
Tasks.bulkCreate([
|
||||
{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: 'Feel free to try it out and hack on it', isCompleted: false},
|
||||
{content: 'Good Luck!', isCompleted: false}
|
||||
]);
|
||||
|
||||
orm.sync();
|
||||
|
||||
Reference in New Issue
Block a user