Skip to content

Commit

Permalink
Dump schema
Browse files Browse the repository at this point in the history
  • Loading branch information
dantecatalfamo committed Sep 25, 2024
1 parent 7fa51b6 commit f72c63c
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package tables

import (
"database/sql"
"fmt"
)

func init() {
MigrationClient.AddMigration(Up_20240925111236, Down_20240925111236)
}

func Up_20240925111236(tx *sql.Tx) error {
_, err := tx.Exec(`ALTER TABLE software_installers ADD COLUMN install_during_setup BOOL NOT NULL DEFAULT false`)
if err != nil {
return fmt.Errorf("failed to add install_during_setup to software_installers: %w", err)
}

_, err = tx.Exec(`ALTER TABLE vpp_apps_teams ADD COLUMN install_during_setup BOOL NOT NULL DEFAULT false`)
if err != nil {
return fmt.Errorf("failed to add vpp_apps_teams to software_installers: %w", err)
}

return nil
}

func Down_20240925111236(tx *sql.Tx) error {
return nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package tables

import (
"database/sql"
"fmt"
)

func init() {
MigrationClient.AddMigration(Up_20240925112748, Down_20240925112748)
}

func Up_20240925112748(tx *sql.Tx) error {
_, err := tx.Exec(`
CREATE TABLE setup_experience_status_results (
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
host_uuid VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL,
type VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL,
name VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL,
status VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL,
execution_id VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL,
error VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (id)
)
`)
if err != nil {
return fmt.Errorf("failed to create setup_experience_status_results table: %w", err)
}

return nil
}

func Down_20240925112748(tx *sql.Tx) error {
return nil
}
Loading

0 comments on commit f72c63c

Please sign in to comment.