Skip to content

Commit

Permalink
feat: add new db migartion
Browse files Browse the repository at this point in the history
  • Loading branch information
goran-ethernal committed Jan 10, 2025
1 parent a5b8984 commit 934bb89
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions l1infotreesync/migrations/l1infotreesync0003.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- +migrate Down
ALTER TABLE block DROP COLUMN hash;

-- +migrate Up
ALTER TABLE block ADD COLUMN hash VARCHAR;
7 changes: 7 additions & 0 deletions l1infotreesync/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ var mig001 string
//go:embed l1infotreesync0002.sql
var mig002 string

//go:embed l1infotreesync0003.sql
var mig003 string

func RunMigrations(dbPath string) error {
migrations := []types.Migration{
{
Expand All @@ -29,6 +32,10 @@ func RunMigrations(dbPath string) error {
ID: "l1infotreesync0002",
SQL: mig002,
},
{
ID: "l1infotreesync0003",
SQL: mig003,
},
}
for _, tm := range treeMigrations.Migrations {
migrations = append(migrations, types.Migration{
Expand Down

0 comments on commit 934bb89

Please sign in to comment.