aboutsummaryrefslogtreecommitdiff
path: root/src/api/database
diff options
context:
space:
mode:
authorPitu <[email protected]>2019-02-23 00:45:45 +0900
committerPitu <[email protected]>2019-02-23 00:45:45 +0900
commitfc95cb7b0f047806937c25f0fc1104c72b0a32cb (patch)
treefcf55a9e1f280dc34912a914e0cc47f69ce0b8c4 /src/api/database
parentUpdate Util.js (diff)
downloadhost.fuwn.me-fc95cb7b0f047806937c25f0fc1104c72b0a32cb.tar.xz
host.fuwn.me-fc95cb7b0f047806937c25f0fc1104c72b0a32cb.zip
Better DB handling and stuff
Diffstat (limited to 'src/api/database')
-rw-r--r--src/api/database/migrations/20190221225812_initialMigration.js10
-rw-r--r--src/api/database/seeds/initial.js1
2 files changed, 6 insertions, 5 deletions
diff --git a/src/api/database/migrations/20190221225812_initialMigration.js b/src/api/database/migrations/20190221225812_initialMigration.js
index 455d5c5..f2192f6 100644
--- a/src/api/database/migrations/20190221225812_initialMigration.js
+++ b/src/api/database/migrations/20190221225812_initialMigration.js
@@ -3,8 +3,8 @@ exports.up = async knex => {
table.increments();
table.string('username');
table.string('password');
- table.boolean('enabled').defaultTo(true);
- table.boolean('isAdmin').defaultTo(false);
+ table.boolean('enabled');
+ table.boolean('isAdmin');
table.string('apiKey');
table.timestamp('passwordEditedAt');
table.timestamp('apiKeyEditedAt');
@@ -39,9 +39,9 @@ exports.up = async knex => {
table.integer('userId');
table.integer('albumId');
table.string('identifier');
- table.integer('views').defaultTo(0);
- table.boolean('enabled').defaultTo(true);
- table.boolean('enableDownload').defaultTo(true);
+ table.integer('views');
+ table.boolean('enabled');
+ table.boolean('enableDownload');
table.timestamp('expiresAt');
table.timestamp('createdAt');
table.timestamp('editedAt');
diff --git a/src/api/database/seeds/initial.js b/src/api/database/seeds/initial.js
index d4a343c..7445916 100644
--- a/src/api/database/seeds/initial.js
+++ b/src/api/database/seeds/initial.js
@@ -16,6 +16,7 @@ exports.seed = async db => {
apiKeyEditedAt: now,
createdAt: now,
editedAt: now,
+ enabled: true,
isAdmin: true
});
console.log();