Reorder migrations
This commit is contained in:
+3
-3
@@ -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
|
||||
}
|
||||
+1
-1
@@ -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)
|
||||
|
||||
+3
-3
@@ -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
|
||||
}
|
||||
+1
-1
@@ -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.
|
||||
Reference in New Issue
Block a user