• R/O
  • HTTP
  • SSH
  • HTTPS

zephyr: Commit

This repository is for zephyr, which is implemented for a GUI of Eos.


Commit MetaInfo

Revision7a4b19f14b3a88475415782fa64794817121346a (tree)
Time2016-01-25 23:20:43
Authorhimetani_cafe <fumifumi@yasu...>
Commiterhimetani_cafe

Log Message

[DEBUG] dbOptionの設定

On branch master
Changes to be committed:
modified: server/class/DB.js

Change Summary

Incremental Difference

--- a/server/class/DB.js
+++ b/server/class/DB.js
@@ -13,11 +13,7 @@ function DB() {
1313
1414 var sequelize;
1515 var test = 'hello';
16-
17- var dbOption = {
18- dialect: 'sqlite'
19- };
20-
16+
2117 /**
2218 * sync
2319 *
@@ -28,15 +24,21 @@ function DB() {
2824 var force = process.env.NODE_ENV !== 'production';
2925 Files.sync({force: force})
3026 .then(function() {
27+ return existDirectory(q);
28+ })
29+ .catch(function() {
3130 var root = {
3231 fileId: '1f83f620-c1ed-11e5-9657-7942989daa00', // rootのuuidは固定値
3332 name: '/',
3433 parentId: '',
3534 fileType: 0
3635 };
36+ /*
3737 if(process.env.NODE_ENV === 'debug') {
3838 return Files.create(root);
3939 }
40+ */
41+ return Files.create(root);
4042 })
4143 .then(function() {
4244 var c = {
@@ -234,7 +236,7 @@ function DB() {
234236 }
235237
236238 if(directory === '/') {
237- resolve('1f83f620-c1ed-11e5-9657-7942989daa00');
239+ resolve('1f83f620-c1ed-11e5-9657-7942989daa00'); // rootのuuid
238240 } else {
239241 arrayDirectory = directory.split('/');
240242 arrayDirectory.shift(); // root
@@ -488,7 +490,7 @@ function DB() {
488490 var q3 = {
489491 fileId: uuid.v1(),
490492 name: 'two',
491- parentId: '1f83f620-c1ed-11e5-9657-7942989daa00',
493+ parentId: '1f83f620-c1ed-11e5-9657-7942989daa00', //rootのuuid
492494 fileType: 0
493495 };
494496 return Files.create(q3);
@@ -523,6 +525,10 @@ function DB() {
523525 */
524526
525527 var dbPath;
528+ var dbOption = {
529+ dialect: 'sqlite'
530+ };
531+
526532 if(process.env['NODE_ENV'] === 'production') {
527533 dbPath = __dirname + '/../../user-specific-files/db/db.workspace';
528534 // if doesn't exist workspace.db, create.
@@ -531,6 +537,7 @@ function DB() {
531537 } catch(e) {
532538 fs.writeFileSync(dbPath, '');
533539 }
540+ dbOption.storage = dbPath;
534541
535542 } else if(process.env['NODE_ENV'] === 'debug') {
536543 dbPath = __dirname + '/../../user-specific-files/db/db.debug';
@@ -541,10 +548,10 @@ function DB() {
541548 }
542549
543550 fs.writeFileSync(dbPath, '');
551+ dbOption.storage = dbPath;
544552 }
545553
546554
547- dbOption.storage = dbPath;
548555
549556 sequelize = new Sequelize('','','', dbOption);
550557
Show on old repository browser