0

Function has been re-exported for use

This commit is contained in:
Gabe Kangas 2022-08-03 11:30:06 -07:00
parent b2b77f5eb9
commit 0470403b71
No known key found for this signature in database
GPG Key ID: 9A56337728BC81EA
2 changed files with 8 additions and 8 deletions

View File

@ -24,15 +24,15 @@ func CreateMessagesTable(db *sql.DB) {
"link" TEXT, "link" TEXT,
PRIMARY KEY (id) PRIMARY KEY (id)
);` );`
mustExec(createTableSQL, db) MustExec(createTableSQL, db)
// Create indexes // Create indexes
mustExec(`CREATE INDEX IF NOT EXISTS user_id_hidden_at_timestamp ON messages (id, user_id, hidden_at, timestamp);`, db) MustExec(`CREATE INDEX IF NOT EXISTS user_id_hidden_at_timestamp ON messages (id, user_id, hidden_at, timestamp);`, db)
mustExec(`CREATE INDEX IF NOT EXISTS idx_id ON messages (id);`, db) MustExec(`CREATE INDEX IF NOT EXISTS idx_id ON messages (id);`, db)
mustExec(`CREATE INDEX IF NOT EXISTS idx_user_id ON messages (user_id);`, db) MustExec(`CREATE INDEX IF NOT EXISTS idx_user_id ON messages (user_id);`, db)
mustExec(`CREATE INDEX IF NOT EXISTS idx_hidden_at ON messages (hidden_at);`, db) MustExec(`CREATE INDEX IF NOT EXISTS idx_hidden_at ON messages (hidden_at);`, db)
mustExec(`CREATE INDEX IF NOT EXISTS idx_timestamp ON messages (timestamp);`, db) MustExec(`CREATE INDEX IF NOT EXISTS idx_timestamp ON messages (timestamp);`, db)
mustExec(`CREATE INDEX IF NOT EXISTS idx_messages_hidden_at_timestamp on messages(hidden_at, timestamp);`, db) MustExec(`CREATE INDEX IF NOT EXISTS idx_messages_hidden_at_timestamp on messages(hidden_at, timestamp);`, db)
} }
// GetMessagesCount will return the number of messages in the database. // GetMessagesCount will return the number of messages in the database.

View File

@ -48,7 +48,7 @@ func migrateToSchema6(db *sql.DB) {
// Fix chat messages table schema. Since chat is ephemeral we can drop // Fix chat messages table schema. Since chat is ephemeral we can drop
// the table and recreate it. // the table and recreate it.
// Drop the old messages table // Drop the old messages table
mustExec(`DROP TABLE messages`, db) MustExec(`DROP TABLE messages`, db)
// Recreate it // Recreate it
CreateMessagesTable(db) CreateMessagesTable(db)