fix: ci typo and migrate overwrite

This commit is contained in:
Andrew Jackson (Ajax) 2023-12-01 12:29:05 -06:00
parent 2d45ac5296
commit b51f1e7861
3 changed files with 14 additions and 5 deletions

View File

@ -1017,7 +1017,7 @@ workflows:
- build - build
suite: utest-unit-cli suite: utest-unit-cli
target: "./cli/... ./cmd/... ./api/..." target: "./cli/... ./cmd/... ./api/..."
resource-class: 2xlarge resource_class: 2xlarge
get-params: true get-params: true
- test: - test:
name: test-unit-node name: test-unit-node
@ -1031,7 +1031,7 @@ workflows:
- build - build
suite: utest-unit-rest suite: utest-unit-rest
target: "./blockstore/... ./build/... ./chain/... ./conformance/... ./gateway/... ./journal/... ./lib/... ./markets/... ./paychmgr/... ./tools/..." target: "./blockstore/... ./build/... ./chain/... ./conformance/... ./gateway/... ./journal/... ./lib/... ./markets/... ./paychmgr/... ./tools/..."
resource-class: 2xlarge resource_class: 2xlarge
- test: - test:
name: test-unit-storage name: test-unit-storage
requires: requires:

View File

@ -570,11 +570,11 @@ workflows:
get-params: true get-params: true
[[- end -]] [[- end -]]
[[- if eq $suite "unit-cli"]] [[- if eq $suite "unit-cli"]]
resource-class: 2xlarge resource_class: 2xlarge
get-params: true get-params: true
[[- end -]] [[- end -]]
[[- if eq $suite "unit-rest"]] [[- if eq $suite "unit-rest"]]
resource-class: 2xlarge resource_class: 2xlarge
[[- end -]] [[- end -]]
[[- end]] [[- end]]
- test: - test:

View File

@ -18,7 +18,6 @@ import (
"golang.org/x/xerrors" "golang.org/x/xerrors"
"github.com/filecoin-project/go-address" "github.com/filecoin-project/go-address"
cliutil "github.com/filecoin-project/lotus/cli/util" cliutil "github.com/filecoin-project/lotus/cli/util"
"github.com/filecoin-project/lotus/lib/harmony/harmonydb" "github.com/filecoin-project/lotus/lib/harmony/harmonydb"
"github.com/filecoin-project/lotus/node/config" "github.com/filecoin-project/lotus/node/config"
@ -198,6 +197,16 @@ func fromMiner(cctx *cli.Context) (err error) {
} }
} }
if cctx.Bool("overwrite") {
i, err := db.Exec(ctx, "DELETE FROM harmony_config WHERE title=$1", name)
if i != 0 {
fmt.Println("Overwriting existing layer")
}
if err != nil {
fmt.Println("Got error while deleting existing layer: " + err.Error())
}
}
_, err = db.Exec(ctx, "INSERT INTO harmony_config (title, config) VALUES ($1, $2)", name, configTOML.String()) _, err = db.Exec(ctx, "INSERT INTO harmony_config (title, config) VALUES ($1, $2)", name, configTOML.String())
if err != nil { if err != nil {
return err return err