var sequelize;
var test = 'hello';
-
- var dbOption = {
- dialect: 'sqlite'
- };
-
+
/**
* sync
*
var force = process.env.NODE_ENV !== 'production';
Files.sync({force: force})
.then(function() {
+ return existDirectory(q);
+ })
+ .catch(function() {
var root = {
fileId: '1f83f620-c1ed-11e5-9657-7942989daa00', // rootのuuidは固定値
name: '/',
parentId: '',
fileType: 0
};
+ /*
if(process.env.NODE_ENV === 'debug') {
return Files.create(root);
}
+ */
+ return Files.create(root);
})
.then(function() {
var c = {
}
if(directory === '/') {
- resolve('1f83f620-c1ed-11e5-9657-7942989daa00');
+ resolve('1f83f620-c1ed-11e5-9657-7942989daa00'); // rootのuuid
} else {
arrayDirectory = directory.split('/');
arrayDirectory.shift(); // root
var q3 = {
fileId: uuid.v1(),
name: 'two',
- parentId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+ parentId: '1f83f620-c1ed-11e5-9657-7942989daa00', //rootのuuid
fileType: 0
};
return Files.create(q3);
*/
var dbPath;
+ var dbOption = {
+ dialect: 'sqlite'
+ };
+
if(process.env['NODE_ENV'] === 'production') {
dbPath = __dirname + '/../../user-specific-files/db/db.workspace';
// if doesn't exist workspace.db, create.
} catch(e) {
fs.writeFileSync(dbPath, '');
}
+ dbOption.storage = dbPath;
} else if(process.env['NODE_ENV'] === 'debug') {
dbPath = __dirname + '/../../user-specific-files/db/db.debug';
}
fs.writeFileSync(dbPath, '');
+ dbOption.storage = dbPath;
}
- dbOption.storage = dbPath;
sequelize = new Sequelize('','','', dbOption);