Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
medialibrary
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
58
Issues
58
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
medialibrary
Commits
367dfaab
Commit
367dfaab
authored
Jan 21, 2016
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't create virtual tables multiple times
parent
39fbdbf7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
src/Album.cpp
src/Album.cpp
+2
-1
src/AlbumTrack.cpp
src/AlbumTrack.cpp
+2
-1
src/Playlist.cpp
src/Playlist.cpp
+2
-1
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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