-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
bfc409b
commit e254ec9
Showing
17 changed files
with
148 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,11 +45,21 @@ jobs: | |
- uses: actions/checkout@v4 | ||
|
||
- name: Checkout kurtosis-cdk repository | ||
uses: actions/checkout@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
env: | ||
GOARCH: ${{ matrix.goarch }} | ||
|
||
- name: Build Docker | ||
run: make build-docker | ||
|
||
- name: Checkout kurtosis-cdk | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: 0xPolygon/kurtosis-cdk | ||
path: kurtosis-cdk | ||
ref: v0.2.22 | ||
ref: v0.2.24 | ||
|
||
- name: Install Kurtosis CDK tools | ||
uses: ./kurtosis-cdk/.github/actions/setup-kurtosis-cdk | ||
|
@@ -64,7 +74,7 @@ jobs: | |
sudo chmod +x /usr/local/bin/polycli | ||
/usr/local/bin/polycli version | ||
- name: Setup bats | ||
- name: Setup Bats and bats libs | ||
uses: bats-core/[email protected] | ||
|
||
- name: Download cdk archive | ||
|
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
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 |
---|---|---|
@@ -1,16 +1,35 @@ | ||
-- +migrate Down | ||
DROP TABLE IF EXISTS certificate_info; | ||
DROP TABLE IF EXISTS certificate_info_history; | ||
DROP TABLE IF EXISTS certificate_info_history; | ||
|
||
-- +migrate Up | ||
CREATE TABLE certificate_info ( | ||
height INTEGER NOT NULL, | ||
certificate_id VARCHAR NOT NULL PRIMARY KEY, | ||
retry_count INTEGER DEFAULT 0, | ||
certificate_id VARCHAR NOT NULL, | ||
status INTEGER NOT NULL, | ||
previous_local_exit_root VARCHAR, | ||
new_local_exit_root VARCHAR NOT NULL, | ||
from_block INTEGER NOT NULL, | ||
to_block INTEGER NOT NULL, | ||
created_at INTEGER NOT NULL, | ||
updated_at INTEGER NOT NULL, | ||
signed_certificate TEXT | ||
); | ||
signed_certificate TEXT, | ||
PRIMARY KEY (height) | ||
); | ||
|
||
CREATE TABLE certificate_info_history ( | ||
height INTEGER NOT NULL , | ||
retry_count INTEGER DEFAULT 0, | ||
certificate_id VARCHAR NOT NULL, | ||
status INTEGER NOT NULL, | ||
previous_local_exit_root VARCHAR, | ||
new_local_exit_root VARCHAR NOT NULL, | ||
from_block INTEGER NOT NULL, | ||
to_block INTEGER NOT NULL, | ||
created_at INTEGER NOT NULL, | ||
updated_at INTEGER NOT NULL, | ||
signed_certificate TEXT, | ||
PRIMARY KEY (height, retry_count) | ||
); |
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 |
---|---|---|
@@ -1,22 +1,24 @@ | ||
package migrations | ||
|
||
import ( | ||
"database/sql" | ||
_ "embed" | ||
|
||
"github.com/0xPolygon/cdk/db" | ||
"github.com/0xPolygon/cdk/db/types" | ||
"github.com/0xPolygon/cdk/log" | ||
) | ||
|
||
//go:embed 0001.sql | ||
var mig001 string | ||
|
||
func RunMigrations(dbPath string) error { | ||
func RunMigrations(logger *log.Logger, database *sql.DB) error { | ||
migrations := []types.Migration{ | ||
{ | ||
ID: "0001", | ||
SQL: mig001, | ||
}, | ||
} | ||
|
||
return db.RunMigrations(dbPath, migrations) | ||
return db.RunMigrationsDB(logger, database, migrations) | ||
} |
Oops, something went wrong.