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

Folder: Make name case insensitive

(cherry picked from commit 5b411c7d)
Signed-off-by: 's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 51faae35
......@@ -75,7 +75,7 @@ Folder::Folder(MediaLibraryPtr ml, const std::string& path,
void Folder::createTable( sqlite::Connection* connection)
{
const std::string reqs[] = {
#include "database/tables/Folder_v14.sql"
#include "database/tables/Folder_v15.sql"
};
for ( const auto& req : reqs )
sqlite::Tools::executeRequest( connection, req );
......@@ -84,7 +84,7 @@ void Folder::createTable( sqlite::Connection* connection)
void Folder::createTriggers( sqlite::Connection* connection, uint32_t modelVersion )
{
const std::string reqs[] = {
#include "database/tables/Folder_triggers_v14.sql"
#include "database/tables/Folder_triggers_v15.sql"
};
for ( const auto& req : reqs )
sqlite::Tools::executeRequest( connection, req );
......
#include "Folder_triggers_v14.sql"
"CREATE TABLE IF NOT EXISTS " + Folder::Table::Name +
"("
"id_folder INTEGER PRIMARY KEY AUTOINCREMENT,"
"path TEXT,"
"name TEXT COLLATE NOCASE,"
"parent_id UNSIGNED INTEGER,"
"is_banned BOOLEAN NOT NULL DEFAULT 0,"
"device_id UNSIGNED INTEGER,"
"is_removable BOOLEAN NOT NULL,"
"nb_audio UNSIGNED INTEGER NOT NULL DEFAULT 0,"
"nb_video UNSIGNED INTEGER NOT NULL DEFAULT 0,"
"FOREIGN KEY (parent_id) REFERENCES " + Folder::Table::Name +
"(id_folder) ON DELETE CASCADE,"
"FOREIGN KEY (device_id) REFERENCES " + Device::Table::Name +
"(id_device) ON DELETE CASCADE,"
"UNIQUE(path, device_id) ON CONFLICT FAIL"
")",
"CREATE INDEX IF NOT EXISTS folder_device_id ON " + Folder::Table::Name +
"(device_id)",
"CREATE INDEX IF NOT EXISTS folder_parent_id ON " + Folder::Table::Name +
"(parent_id)",
"CREATE TABLE IF NOT EXISTS ExcludedEntryFolder"
"("
"folder_id UNSIGNED INTEGER NOT NULL,"
"FOREIGN KEY (folder_id) REFERENCES " + Folder::Table::Name +
"(id_folder) ON DELETE CASCADE,"
"UNIQUE(folder_id) ON CONFLICT FAIL"
")",
"CREATE VIRTUAL TABLE IF NOT EXISTS " + Folder::Table::Name + "Fts USING FTS3"
"("
"name"
")",
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