Create playqueue table and repository

This commit is contained in:
Deluan
2020-07-31 11:42:51 -04:00
committed by Deluan Quintão
parent 3c2b14d362
commit 721a959735
4 changed files with 303 additions and 0 deletions
@@ -0,0 +1,36 @@
package migration
import (
"database/sql"
"github.com/pressly/goose"
)
func init() {
goose.AddMigration(upCreatePlayQueuesTable, downCreatePlayQueuesTable)
}
func upCreatePlayQueuesTable(tx *sql.Tx) error {
_, err := tx.Exec(`
create table playqueue
(
id varchar(255) not null,
user_id varchar(255) not null
references user (id)
on update cascade on delete cascade,
comment varchar(255),
current varchar(255),
position real,
changed_by varchar(255),
items varchar(255),
created_at datetime,
updated_at datetime
);
`)
return err
}
func downCreatePlayQueuesTable(tx *sql.Tx) error {
return nil
}