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

migration: Clear temporary tables after the migration

parent e759949f
......@@ -58,6 +58,8 @@
"CASE thumbnail WHEN NULL THEN 0 WHEN '' THEN 0 ELSE 1 END,"
"title, filename, is_favorite, is_present FROM " + MediaTable::Name + "_backup",
"DROP TABLE " + MediaTable::Name + "_backup",
/******************* Migrate metadata table ***********************************/
"CREATE TEMPORARY TABLE " + MetadataTable::Name + "_backup"
"("
......@@ -81,6 +83,8 @@
", type, value "
"FROM " + MetadataTable::Name + "_backup",
"DROP TABLE " + MetadataTable::Name + "_backup",
/******************* Migrate the playlist table *******************************/
"CREATE TEMPORARY TABLE " + PlaylistTable::Name + "_backup"
"("
......@@ -110,6 +114,9 @@
"INSERT INTO PlaylistMediaRelation SELECT media_id, NULL, playlist_id, position "
"FROM PlaylistMediaRelation_backup",
"DROP TABLE " + PlaylistTable::Name + "_backup",
"DROP TABLE PlaylistMediaRelation_backup",
/******************* Migrate Device table *************************************/
"CREATE TEMPORARY TABLE " + policy::DeviceTable::Name + "_backup"
......@@ -130,6 +137,8 @@
"INSERT INTO " + DeviceTable::Name + " SELECT id_device, uuid, scheme, is_removable, is_present,"
"strftime('%s', 'now') FROM " + DeviceTable::Name,
"DROP TABLE " + DeviceTable::Name + "_backup",
/******************* Delete other tables **************************************/
"DROP TABLE " + AlbumTable::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