mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
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:
parent
94f5ee7832
commit
e011cfc464
1 changed files with 23 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
Loading…
Reference in a new issue