mirror of
https://github.com/idanoo/GoDiscMoji
synced 2025-07-02 10:52:14 +00:00
Add scrubber :>
This commit is contained in:
parent
de5ae550e0
commit
ca38e5bb85
6 changed files with 310 additions and 43 deletions
|
@ -36,7 +36,6 @@ func InitDb() (*Database, error) {
|
|||
|
||||
// runMigrations - Run migrations for connection
|
||||
func (db *Database) runMigrations() (*Database, error) {
|
||||
// Hacked up af - Rerunnable
|
||||
_, err := db.db.Exec("CREATE TABLE IF NOT EXISTS `emoji_usage` (" +
|
||||
"`id` INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
"`guild_id` TEXT, " +
|
||||
|
@ -61,6 +60,21 @@ func (db *Database) runMigrations() (*Database, error) {
|
|||
return db, err
|
||||
}
|
||||
|
||||
_, err = db.db.Exec("CREATE TABLE IF NOT EXISTS `auto_scrubber` (" +
|
||||
"`id` INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
"`guild_id` TEXT, " +
|
||||
"`user_id` TEXT, " +
|
||||
"`duration` INT " +
|
||||
")")
|
||||
if err != nil {
|
||||
return db, err
|
||||
}
|
||||
|
||||
_, err = db.db.Exec("CREATE INDEX IF NOT EXISTS `idx_auto_scrubber_guild_user` ON `auto_scrubber` (`guild_id`, `user_id`)")
|
||||
if err != nil {
|
||||
return db, err
|
||||
}
|
||||
|
||||
// emojitest := map[string]string{
|
||||
// "pepe_analyze": "579431592624390147",
|
||||
// "kekw": "1317987954102112347",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue