Skip to content

Commit

Permalink
Merge pull request #1486 from smallstep/migrate-admindb
Browse files Browse the repository at this point in the history
Add to the migration script the admin tables
  • Loading branch information
maraino authored Jul 21, 2023
2 parents 31533c4 + aa30c2c commit d89c3a9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/badger-migration/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ var (
"acme_external_account_keyID_reference_index",
"acme_external_account_keyID_provisionerID_index",
}
adminTables = []string{
"admins",
"provisioners",
"authority_policies",
}
)

func usage(fs *flag.FlagSet) {
Expand All @@ -67,7 +72,7 @@ func main() {
fs := flag.NewFlagSet(os.Args[0], flag.ExitOnError)

fs.BoolVar(&v1, "v1", false, "use badger v1 as the source database")
fs.BoolVar(&v2, "v2", true, "use badger v2 as the source database")
fs.BoolVar(&v2, "v2", false, "use badger v2 as the source database")
fs.StringVar(&dir, "dir", "", "badger database directory")
fs.StringVar(&valueDir, "value-dir", "", "badger database value directory")
fs.StringVar(&typ, "type", "", "the destination database type to use")
Expand Down Expand Up @@ -117,6 +122,7 @@ func main() {

allTables := append([]string{}, authorityTables...)
allTables = append(allTables, acmeTables...)
allTables = append(allTables, adminTables...)

// Convert prefix names to badger key prefixes
badgerKeys := make([][]byte, len(allTables))
Expand Down

0 comments on commit d89c3a9

Please sign in to comment.