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

Metadata: Split table creation in a separated sql file

parent 093e0a58
......@@ -183,14 +183,11 @@ void Metadata::unset( sqlite::Connection* dbConn, IMetadata::EntityType entityTy
void Metadata::createTable(sqlite::Connection* connection)
{
const std::string req = "CREATE TABLE IF NOT EXISTS " + policy::MetadataTable::Name + "("
"id_media INTEGER,"
"entity_type INTEGER,"
"type INTEGER,"
"value TEXT,"
"PRIMARY KEY (id_media, entity_type, type)"
")";
sqlite::Tools::executeRequest( connection, req );
const std::string reqs[] = {
#include "database/tables/Metadata_v14.sql"
};
for ( const auto& req : reqs )
sqlite::Tools::executeRequest( connection, req );
}
void Metadata::Record::set( const std::string& value )
......
"CREATE TABLE IF NOT EXISTS " + policy::MetadataTable::Name +
"("
"id_media INTEGER,"
"entity_type INTEGER,"
"type INTEGER,"
"value TEXT,"
"PRIMARY KEY (id_media, entity_type, type)"
")",
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