mirror of
https://github.com/owncast/owncast.git
synced 2024-11-24 13:50:06 +03:00
22 lines
572 B
Go
22 lines
572 B
Go
|
package tables
|
||
|
|
||
|
import (
|
||
|
"database/sql"
|
||
|
|
||
|
"github.com/owncast/owncast/utils"
|
||
|
log "github.com/sirupsen/logrus"
|
||
|
)
|
||
|
|
||
|
func CreateNotificationsTable(db *sql.DB) {
|
||
|
log.Traceln("Creating federation followers table...")
|
||
|
|
||
|
createTableSQL := `CREATE TABLE IF NOT EXISTS notifications (
|
||
|
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||
|
"channel" TEXT NOT NULL,
|
||
|
"destination" TEXT NOT NULL,
|
||
|
"created_at" TIMESTAMP DEFAULT CURRENT_TIMESTAMP);`
|
||
|
|
||
|
utils.MustExec(createTableSQL, db)
|
||
|
utils.MustExec(`CREATE INDEX IF NOT EXISTS idx_channel ON notifications (channel);`, db)
|
||
|
}
|