aboutsummaryrefslogtreecommitdiff
path: root/src/api/database
diff options
context:
space:
mode:
authorPitu <[email protected]>2019-03-14 23:14:37 +0900
committerPitu <[email protected]>2019-03-14 23:14:37 +0900
commit497a961a3844afccc763ebdfa2d77f107318394a (patch)
tree429d0f462107f9352c959c7eaa6b24c73f1f791e /src/api/database
parentSmall fixes (diff)
downloadhost.fuwn.me-497a961a3844afccc763ebdfa2d77f107318394a.tar.xz
host.fuwn.me-497a961a3844afccc763ebdfa2d77f107318394a.zip
Tags
Diffstat (limited to 'src/api/database')
-rw-r--r--src/api/database/migrations/20190221225813_addTags.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/api/database/migrations/20190221225813_addTags.js b/src/api/database/migrations/20190221225813_addTags.js
new file mode 100644
index 0000000..ef71877
--- /dev/null
+++ b/src/api/database/migrations/20190221225813_addTags.js
@@ -0,0 +1,21 @@
+exports.up = async knex => {
+ await knex.schema.createTable('tags', table => {
+ table.increments();
+ table.string('uuid');
+ table.integer('userId');
+ table.string('name');
+ table.timestamp('createdAt');
+ table.timestamp('editedAt');
+ });
+
+ await knex.schema.createTable('fileTags', table => {
+ table.increments();
+ table.integer('fileId');
+ table.integer('tagId');
+ });
+};
+
+exports.down = async knex => {
+ await knex.schema.dropTableIfExists('tags');
+ await knex.schema.dropTableIfExists('fileTags');
+};