mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-26 04:33:00 -05:00
Create index
Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
This commit is contained in:
@@ -171,6 +171,9 @@ VALUES
|
|||||||
playlist_url = excluded.playlist_url,
|
playlist_url = excluded.playlist_url,
|
||||||
tracks = excluded.tracks;
|
tracks = excluded.tracks;
|
||||||
"""
|
"""
|
||||||
|
_CREATE_INDEX = """
|
||||||
|
CREATE INDEX IF NOT EXISTS name_index ON playlists (scope_type, playlist_id, playlist_name, scope_id);
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@@ -205,6 +208,7 @@ class Database:
|
|||||||
self.cursor.execute(_PRAGMA_UPDATE_journal_mode)
|
self.cursor.execute(_PRAGMA_UPDATE_journal_mode)
|
||||||
self.cursor.execute(_PRAGMA_UPDATE_read_uncommitted)
|
self.cursor.execute(_PRAGMA_UPDATE_read_uncommitted)
|
||||||
self.cursor.execute(_CREATE_TABLE)
|
self.cursor.execute(_CREATE_TABLE)
|
||||||
|
self.cursor.execute(_CREATE_INDEX)
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
self._database.close()
|
self._database.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user