From 53f5015c99b3040e955632525bde4ad70250af9a Mon Sep 17 00:00:00 2001 From: Zephyrrus Date: Tue, 5 Jan 2021 00:25:53 +0200 Subject: feat: check for real mimetype using file-type For now, if file-type returns undefined, we take the value from the browser. In the future this should be removed to ensure people can't bypass the real mime checking using a special file that can't be recognized by file-type. --- src/api/database/migrations/20201227023216_addUniques.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/api/database/migrations/20201227023216_addUniques.js') diff --git a/src/api/database/migrations/20201227023216_addUniques.js b/src/api/database/migrations/20201227023216_addUniques.js index 14f9e7f..d031991 100644 --- a/src/api/database/migrations/20201227023216_addUniques.js +++ b/src/api/database/migrations/20201227023216_addUniques.js @@ -28,6 +28,6 @@ exports.up = async knex => { table.unique(['fileId', 'tagId']); }); }; -exports.down = async knex => { +exports.down = async () => { // Nothing }; -- cgit v1.2.3 From f151a8ac3a8f944829e55fc007823b167f1a2597 Mon Sep 17 00:00:00 2001 From: Zephyrrus Date: Tue, 5 Jan 2021 22:58:41 +0200 Subject: chore: Move statistics related functions to it's own file fix: Extract database constructor to a separate file to ensure we only create one knex instance/db feat: Add cron for saving the stats to the database every hour feat: Get cached stats from database (if a stat is not found in the db, generate it) --- src/api/database/migrations/20201227023216_addUniques.js | 1 + 1 file changed, 1 insertion(+) (limited to 'src/api/database/migrations/20201227023216_addUniques.js') diff --git a/src/api/database/migrations/20201227023216_addUniques.js b/src/api/database/migrations/20201227023216_addUniques.js index d031991..8292f15 100644 --- a/src/api/database/migrations/20201227023216_addUniques.js +++ b/src/api/database/migrations/20201227023216_addUniques.js @@ -28,6 +28,7 @@ exports.up = async knex => { table.unique(['fileId', 'tagId']); }); }; + exports.down = async () => { // Nothing }; -- cgit v1.2.3