mirror of https://github.com/waku-org/nwaku.git
add new index to optimize the order by storedAt (#2778)
This commit is contained in:
parent
24661ea969
commit
3a93437300
|
@ -0,0 +1,6 @@
|
|||
const ContentScriptVersion_5* =
|
||||
"""
|
||||
CREATE INDEX IF NOT EXISTS i_query_storedAt ON messages (storedAt, id);
|
||||
|
||||
UPDATE version SET version = 5 WHERE version = 4;
|
||||
"""
|
|
@ -1,6 +1,6 @@
|
|||
import
|
||||
content_script_version_1, content_script_version_2, content_script_version_3,
|
||||
content_script_version_4
|
||||
content_script_version_4, content_script_version_5
|
||||
|
||||
type MigrationScript* = object
|
||||
version*: int
|
||||
|
@ -15,6 +15,7 @@ const PgMigrationScripts* =
|
|||
MigrationScript(version: 2, scriptContent: ContentScriptVersion_2),
|
||||
MigrationScript(version: 3, scriptContent: ContentScriptVersion_3),
|
||||
MigrationScript(version: 4, scriptContent: ContentScriptVersion_4),
|
||||
MigrationScript(version: 5, scriptContent: ContentScriptVersion_5),
|
||||
]
|
||||
|
||||
proc getMigrationScripts*(currentVersion: int64, targetVersion: int64): seq[string] =
|
||||
|
|
|
@ -9,7 +9,7 @@ import
|
|||
logScope:
|
||||
topics = "waku archive migration"
|
||||
|
||||
const SchemaVersion* = 4 # increase this when there is an update in the database schema
|
||||
const SchemaVersion* = 5 # increase this when there is an update in the database schema
|
||||
|
||||
proc breakIntoStatements*(script: string): seq[string] =
|
||||
## Given a full migration script, that can potentially contain a list
|
||||
|
|
Loading…
Reference in New Issue