Uses primary key to reuse rowId instead of building a separate index.

This commit is contained in:
Vitor Pamplona
2025-12-26 14:31:18 -05:00
parent 720e4d2c87
commit ef5ed755be
@@ -29,7 +29,7 @@ class ExpirationModule : IModule {
db.execSQL( db.execSQL(
""" """
CREATE TABLE event_expirations ( CREATE TABLE event_expirations (
event_header_row_id INTEGER, event_header_row_id INTEGER PRIMARY KEY NOT NULL,
expiration INTEGER NOT NULL, expiration INTEGER NOT NULL,
FOREIGN KEY (event_header_row_id) REFERENCES event_headers(row_id) ON DELETE CASCADE FOREIGN KEY (event_header_row_id) REFERENCES event_headers(row_id) ON DELETE CASCADE
) )
@@ -49,8 +49,6 @@ class ExpirationModule : IModule {
END; END;
""".trimIndent(), """.trimIndent(),
) )
db.execSQL("CREATE UNIQUE INDEX events_exp_id ON event_expirations (event_header_row_id)")
} }
override fun drop(db: SQLiteDatabase) { override fun drop(db: SQLiteDatabase) {