1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-09 07:36:48 +02:00

* Fixed broken database schema for dynamic_playlist table.

This commit is contained in:
Christian Muehlhaeuser
2011-06-24 09:24:41 +02:00
parent bfec4043f6
commit 9758324128
5 changed files with 25 additions and 6 deletions

View File

@@ -0,0 +1,18 @@
-- Script to migate from db version 24 to 25.
-- Added the social_attributes table.
--
-- Separate each command with %%
ALTER TABLE dynamic_playlist RENAME TO tmp_dynamic_playlist;
CREATE TABLE IF NOT EXISTS dynamic_playlist (
guid TEXT NOT NULL REFERENCES playlist(guid) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,
pltype TEXT, -- the generator type
plmode INTEGER -- the mode of this playlist
);
INSERT INTO dynamic_playlist( guid, pltype, plmode ) SELECT guid, pltype, plmode FROM tmp_dynamic_playlist;
DROP TABLE tmp_dynamic_playlist;
UPDATE settings SET v = '25' WHERE k == 'schema_version';

View File

@@ -96,5 +96,6 @@
<file>./data/www/tomahawk_banner_small.png</file> <file>./data/www/tomahawk_banner_small.png</file>
<file>./data/sql/dbmigrate-22_to_23.sql</file> <file>./data/sql/dbmigrate-22_to_23.sql</file>
<file>./data/sql/dbmigrate-23_to_24.sql</file> <file>./data/sql/dbmigrate-23_to_24.sql</file>
<file>./data/sql/dbmigrate-24_to_25.sql</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@@ -38,7 +38,7 @@
*/ */
#include "schema.sql.h" #include "schema.sql.h"
#define CURRENT_SCHEMA_VERSION 24 #define CURRENT_SCHEMA_VERSION 25
DatabaseImpl::DatabaseImpl( const QString& dbname, Database* parent ) DatabaseImpl::DatabaseImpl( const QString& dbname, Database* parent )

View File

@@ -106,7 +106,7 @@ CREATE TABLE IF NOT EXISTS playlist_revision (
-- VALUES('revisionguid-11', 'dynamic_playlist-guid-2', '[]'); -- VALUES('revisionguid-11', 'dynamic_playlist-guid-2', '[]');
CREATE TABLE IF NOT EXISTS dynamic_playlist ( CREATE TABLE IF NOT EXISTS dynamic_playlist (
guid TEXT PRIMARY KEY, guid TEXT NOT NULL REFERENCES playlist(guid) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,
pltype TEXT, -- the generator type pltype TEXT, -- the generator type
plmode INTEGER -- the mode of this playlist plmode INTEGER -- the mode of this playlist
); );
@@ -282,4 +282,4 @@ CREATE TABLE IF NOT EXISTS settings (
v TEXT NOT NULL DEFAULT '' v TEXT NOT NULL DEFAULT ''
); );
INSERT INTO settings(k,v) VALUES('schema_version', '24'); INSERT INTO settings(k,v) VALUES('schema_version', '25');

View File

@@ -1,5 +1,5 @@
/* /*
This file was automatically generated from ./schema.sql on Sun Jun 12 05:17:25 CEST 2011. This file was automatically generated from ./schema.sql on Fri Jun 24 09:10:23 CEST 2011.
*/ */
static const char * tomahawk_schema_sql = static const char * tomahawk_schema_sql =
@@ -76,7 +76,7 @@ static const char * tomahawk_schema_sql =
" previous_revision TEXT REFERENCES playlist_revision(guid) DEFERRABLE INITIALLY DEFERRED" " previous_revision TEXT REFERENCES playlist_revision(guid) DEFERRABLE INITIALLY DEFERRED"
");" ");"
"CREATE TABLE IF NOT EXISTS dynamic_playlist (" "CREATE TABLE IF NOT EXISTS dynamic_playlist ("
" guid TEXT PRIMARY KEY," " guid TEXT NOT NULL REFERENCES playlist(guid) ON DELETE CASCADE ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED,"
" pltype TEXT, " " pltype TEXT, "
" plmode INTEGER " " plmode INTEGER "
");" ");"
@@ -183,7 +183,7 @@ static const char * tomahawk_schema_sql =
" k TEXT NOT NULL PRIMARY KEY," " k TEXT NOT NULL PRIMARY KEY,"
" v TEXT NOT NULL DEFAULT ''" " v TEXT NOT NULL DEFAULT ''"
");" ");"
"INSERT INTO settings(k,v) VALUES('schema_version', '24');" "INSERT INTO settings(k,v) VALUES('schema_version', '25');"
; ;
const char * get_tomahawk_sql() const char * get_tomahawk_sql()