Function has been re-exported for use
This commit is contained in:
parent
b2b77f5eb9
commit
0470403b71
@ -24,15 +24,15 @@ func CreateMessagesTable(db *sql.DB) {
|
||||
"link" TEXT,
|
||||
PRIMARY KEY (id)
|
||||
);`
|
||||
mustExec(createTableSQL, db)
|
||||
MustExec(createTableSQL, db)
|
||||
|
||||
// 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 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_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_messages_hidden_at_timestamp on messages(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_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_timestamp ON messages (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.
|
||||
|
@ -48,7 +48,7 @@ func migrateToSchema6(db *sql.DB) {
|
||||
// Fix chat messages table schema. Since chat is ephemeral we can drop
|
||||
// the table and recreate it.
|
||||
// Drop the old messages table
|
||||
mustExec(`DROP TABLE messages`, db)
|
||||
MustExec(`DROP TABLE messages`, db)
|
||||
|
||||
// Recreate it
|
||||
CreateMessagesTable(db)
|
||||
|
Loading…
x
Reference in New Issue
Block a user