From 488880cacb1d06a4e0f8ccfc0378d5e1781fab41 Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Fri, 18 Jun 2021 08:14:32 +0200
Subject: [PATCH] DB: In memory db cache, permit some fields to be 0 by default
 as they may not be known when downloading a kara

---
 src/database/memory.sql | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/database/memory.sql b/src/database/memory.sql
index 8b98cfef..1de17971 100644
--- a/src/database/memory.sql
+++ b/src/database/memory.sql
@@ -34,11 +34,11 @@ CREATE TABLE IF NOT EXISTS queue_tmp
 
 -- Memory replica of the kara cache
 CREATE TABLE IF NOT EXISTS kara_cache
-  ( kara_id     INTEGER NOT NULL    -- Valid kara id, can't foreign key as the disk is not loaded
-  , mtime       INTEGER NOT NULL    -- Last modification date
-  , duration    INTEGER NOT NULL    -- Duration of the kara
-  , file_path   TEXT    NOT NULL    -- Cached filepath
-  , magic_error INTEGER NOT NULL    -- 1 if the mkv is valid, 0 otherwise
+  ( kara_id     INTEGER NOT NULL            -- Valid kara id, can't foreign key as the disk is not loaded
+  , mtime       INTEGER NOT NULL DEFAULT 0  -- Last modification date
+  , duration    INTEGER NOT NULL DEFAULT 0  -- Duration of the kara
+  , file_path   TEXT    NOT NULL            -- Cached filepath
+  , magic_error INTEGER NOT NULL DEFAULT 0  -- 1 if the mkv is valid, 0 otherwise
   );
 
 -- Used to store the content of the ini configuration file.
-- 
GitLab