Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
367dfaab
Commit
367dfaab
authored
Jan 21, 2016
by
Hugo Beauzée-Luyssen
Browse files
Don't create virtual tables multiple times
parent
39fbdbf7
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Album.cpp
View file @
367dfaab
...
...
@@ -279,7 +279,8 @@ bool Album::createTable(DBConnection dbConnection )
"FOREIGN KEY(artist_id) REFERENCES "
+
policy
::
ArtistTable
::
Name
+
"("
+
policy
::
ArtistTable
::
PrimaryKeyColumn
+
") ON DELETE CASCADE"
")"
;
static
const
std
::
string
vtableReq
=
"CREATE VIRTUAL TABLE "
+
policy
::
AlbumTable
::
Name
+
"Fts USING FTS3("
static
const
std
::
string
vtableReq
=
"CREATE VIRTUAL TABLE IF NOT EXISTS "
+
policy
::
AlbumTable
::
Name
+
"Fts USING FTS3("
"title,"
"artist"
")"
;
...
...
src/AlbumTrack.cpp
View file @
367dfaab
...
...
@@ -112,7 +112,8 @@ bool AlbumTrack::createTable( DBConnection dbConnection )
" BEGIN"
" UPDATE "
+
policy
::
AlbumTrackTable
::
Name
+
" SET is_present = new.is_present WHERE media_id = new.id_media;"
" END"
;
static
const
std
::
string
vtableReq
=
"CREATE VIRTUAL TABLE "
+
policy
::
AlbumTrackTable
::
Name
+
"Fts USING FTS3("
static
const
std
::
string
vtableReq
=
"CREATE VIRTUAL TABLE IF NOT EXISTS "
+
policy
::
AlbumTrackTable
::
Name
+
"Fts USING FTS3("
"title"
")"
;
static
const
std
::
string
vtableTrigger
=
"CREATE TRIGGER IF NOT EXISTS delete_fts_track"
...
...
src/Playlist.cpp
View file @
367dfaab
...
...
@@ -128,7 +128,8 @@ bool Playlist::createTable( DBConnection dbConn )
"FOREIGN KEY(playlist_id) REFERENCES "
+
policy
::
PlaylistTable
::
Name
+
"("
+
policy
::
PlaylistTable
::
PrimaryKeyColumn
+
") ON DELETE CASCADE"
")"
;
static
const
std
::
string
vtableReq
=
"CREATE VIRTUAL TABLE "
+
policy
::
PlaylistTable
::
Name
+
"Fts USING FTS3("
static
const
std
::
string
vtableReq
=
"CREATE VIRTUAL TABLE IF NOT EXISTS "
+
policy
::
PlaylistTable
::
Name
+
"Fts USING FTS3("
"name"
")"
;
//FIXME Enforce (playlist_id,position) uniqueness
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment