-
Notifications
You must be signed in to change notification settings - Fork 547
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(templates): scaffold module migrations
- Loading branch information
1 parent
0dbdd2c
commit 0911832
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
ignite/templates/module/create/files/base/x/{{moduleName}}/keeper/migrate.go.plush
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,15 @@ | ||
package keeper | ||
|
||
// Migrator is a struct for handling in-place store migrations. | ||
type Migrator struct { | ||
keeper *Keeper | ||
} | ||
|
||
// NewMigrator returns a new Migrator. | ||
func NewMigrator(keeper *Keeper) Migrator { | ||
return Migrator{ | ||
keeper: keeper, | ||
} | ||
} | ||
|
||
// this line is used by starport scaffolding # migrations/migrator |
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
14 changes: 14 additions & 0 deletions
14
...lates/module/create/files/migrations/x/{{moduleName}}/migrations/{{num}}/migrate.go.plush
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 @@ | ||
package {{ num }} | ||
|
||
import ( | ||
"context" | ||
|
||
corestoretypes "cosmossdk.io/core/store" | ||
|
||
"github.com/cosmos/cosmos-sdk/codec" | ||
) | ||
|
||
// MigrateStore migrates the module to consensus version {{ num }}. | ||
func MigrateStore(ctx context.Context, storeService corestoretypes.KVStoreService, cdc codec.BinaryCodec) { | ||
// Insert {{ num }} migration here. | ||
} |
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