-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use sqlite on lastgersync (#150)
* feat use sqlite on lastgersync * apply requests * rm tree migrations * Update lastgersync/processor.go Co-authored-by: Goran Rojovic <[email protected]> --------- Co-authored-by: Goran Rojovic <[email protected]>
- Loading branch information
1 parent
faa2a74
commit 6d8dd74
Showing
9 changed files
with
141 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-- +migrate Down | ||
DROP TABLE IF EXISTS block; | ||
DROP TABLE IF EXISTS global_exit_root; | ||
|
||
-- +migrate Up | ||
CREATE TABLE block ( | ||
num BIGINT PRIMARY KEY | ||
); | ||
|
||
CREATE TABLE imported_global_exit_root ( | ||
block_num INTEGER PRIMARY KEY REFERENCES block(num) ON DELETE CASCADE, | ||
global_exit_root VARCHAR NOT NULL, | ||
l1_info_tree_index INTEGER NOT NULL | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package migrations | ||
|
||
import ( | ||
_ "embed" | ||
|
||
"github.com/0xPolygon/cdk/db" | ||
"github.com/0xPolygon/cdk/db/types" | ||
) | ||
|
||
//go:embed lastgersync0001.sql | ||
var mig001 string | ||
|
||
func RunMigrations(dbPath string) error { | ||
migrations := []types.Migration{ | ||
{ | ||
ID: "lastgersync0001", | ||
SQL: mig001, | ||
}, | ||
} | ||
return db.RunMigrations(dbPath, migrations) | ||
} |
Oops, something went wrong.