diff --git a/waku/waku_archive/driver/postgres_driver/postgres_driver.nim b/waku/waku_archive/driver/postgres_driver/postgres_driver.nim index 014d9e001d..e41f85b77c 100644 --- a/waku/waku_archive/driver/postgres_driver/postgres_driver.nim +++ b/waku/waku_archive/driver/postgres_driver/postgres_driver.nim @@ -37,7 +37,7 @@ proc createTableQuery(): string = " id VARCHAR NOT NULL," & " messageHash VARCHAR NOT NULL," & " storedAt BIGINT NOT NULL," & - " CONSTRAINT messageIndex PRIMARY KEY (storedAt, messageHash)" & + " CONSTRAINT messageIndex PRIMARY KEY (messageHash)" & ");" const InsertRowStmtName = "InsertRow" diff --git a/waku/waku_archive/driver/sqlite_driver/queries.nim b/waku/waku_archive/driver/sqlite_driver/queries.nim index 9641b479ca..e03246c5eb 100644 --- a/waku/waku_archive/driver/sqlite_driver/queries.nim +++ b/waku/waku_archive/driver/sqlite_driver/queries.nim @@ -73,7 +73,7 @@ proc createTableQuery(table: string): SqlQueryStr = " id BLOB," & " messageHash BLOB," & " storedAt INTEGER NOT NULL," & - " CONSTRAINT messageIndex PRIMARY KEY (storedAt, messageHash)" & + " CONSTRAINT messageIndex PRIMARY KEY (messageHash)" & ") WITHOUT ROWID;" proc createTable*(db: SqliteDatabase): DatabaseResult[void] =