mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Reorder migrations
This commit is contained in:
parent
ddd77efa9d
commit
10c6390b94
4 changed files with 8 additions and 8 deletions
|
|
@ -5,14 +5,14 @@ import (
|
|||
)
|
||||
|
||||
func init() {
|
||||
MigrationClient.AddMigration(Up_20231002120317, Down_20231002120317)
|
||||
MigrationClient.AddMigration(Up_20231009094543, Down_20231009094543)
|
||||
}
|
||||
|
||||
func Up_20231002120317(tx *sql.Tx) error {
|
||||
func Up_20231009094543(tx *sql.Tx) error {
|
||||
_, err := tx.Exec(`ALTER TABLE queries ADD COLUMN discard_data TINYINT(1) NOT NULL DEFAULT TRUE;`)
|
||||
return err
|
||||
}
|
||||
|
||||
func Down_20231002120317(tx *sql.Tx) error {
|
||||
func Down_20231009094543(tx *sql.Tx) error {
|
||||
return nil
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestUp_20231002120317(t *testing.T) {
|
||||
func TestUp_20231009094543(t *testing.T) {
|
||||
db := applyUpToPrev(t)
|
||||
applyNext(t, db)
|
||||
|
||||
|
|
@ -6,10 +6,10 @@ import (
|
|||
)
|
||||
|
||||
func init() {
|
||||
MigrationClient.AddMigration(Up_20231004144338, Down_20231004144338)
|
||||
MigrationClient.AddMigration(Up_20231009094544, Down_20231009094544)
|
||||
}
|
||||
|
||||
func Up_20231004144338(tx *sql.Tx) error {
|
||||
func Up_20231009094544(tx *sql.Tx) error {
|
||||
_, err := tx.Exec(`
|
||||
CREATE TABLE query_results (
|
||||
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
||||
|
|
@ -29,6 +29,6 @@ func Up_20231004144338(tx *sql.Tx) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func Down_20231004144338(tx *sql.Tx) error {
|
||||
func Down_20231009094544(tx *sql.Tx) error {
|
||||
return nil
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ import (
|
|||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestUp_20231004144338(t *testing.T) {
|
||||
func TestUp_20231009094544(t *testing.T) {
|
||||
db := applyUpToPrev(t)
|
||||
|
||||
// Apply current migration.
|
||||
Loading…
Reference in a new issue