Delete packs that have already been soft-deleted (#1924)

We no longer use soft deletion, so this commit introduces a migration that hard
deletes existing deleted packs.

Fixes #1923
This commit is contained in:
Zachary Wasserman 2018-09-12 17:50:30 -07:00 committed by GitHub
parent 94f5ee7832
commit e011cfc464
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,23 @@
package data
import (
"database/sql"
"github.com/pkg/errors"
)
func init() {
MigrationClient.AddMigration(Up20171212182459, Down20171212182459)
}
func Up20171212182459(tx *sql.Tx) error {
sql := `DELETE FROM packs WHERE deleted = 1`
if _, err := tx.Exec(sql); err != nil {
return errors.Wrap(err, "delete packs")
}
return nil
}
func Down20171212182459(tx *sql.Tx) error {
return nil
}