Commit cb253ce8 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

migration: Use the media database model file

parent fc8e82d2
......@@ -24,26 +24,7 @@
"DROP TABLE " + MediaTable::Name,
"CREATE TABLE " + MediaTable::Name + "("
"id_media INTEGER PRIMARY KEY AUTOINCREMENT,"
"type INTEGER,"
"subtype INTEGER NOT NULL DEFAULT " +
std::to_string( static_cast<typename std::underlying_type<IMedia::SubType>::type>(
IMedia::SubType::Unknown ) ) + ","
"duration INTEGER DEFAULT -1,"
"play_count UNSIGNED INTEGER,"
"last_played_date UNSIGNED INTEGER,"
"insertion_date UNSIGNED INTEGER,"
"release_date UNSIGNED INTEGER,"
"thumbnail_id INTEGER,"
"thumbnail_generated BOOLEAN NOT NULL DEFAULT 0,"
"title TEXT COLLATE NOCASE,"
"filename TEXT,"
"is_favorite BOOLEAN NOT NULL DEFAULT 0,"
"is_present BOOLEAN NOT NULL DEFAULT 1,"
"FOREIGN KEY(thumbnail_id) REFERENCES " + ThumbnailTable::Name
+ "(id_thumbnail)"
")",
#include "database/tables/Media_v14.sql"
"INSERT INTO " + MediaTable::Name + "("
"id_media, type, subtype, duration, play_count, last_played_date, insertion_date,"
......
......@@ -27,4 +27,4 @@
+ policy::MediaTable::Name + "Fts USING FTS3("
"title,"
"labels"
")"
")",
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment