Commit 8481cd7c authored by acud's avatar acud Committed by GitHub

localstore: add breaking migration (#1610)

parent 4c74b592
......@@ -32,7 +32,10 @@ type migration struct {
// schemaMigrations contains an ordered list of the database schemes, that is
// in order to run data migrations in the correct sequence
var schemaMigrations = []migration{
{name: DbSchemaCode, fn: func(db *DB) error { return nil }},
{name: DbSchemaCode, fn: func(_ *DB) error { return nil }},
{name: DbSchemaYuj, fn: func(_ *DB) error {
return errors.New("db schema incompatible. you must migrate your data manually. see the release notes for more info")
}},
}
func (db *DB) migrate(schemaName string) error {
......
......@@ -18,10 +18,14 @@ package localstore
// The DB schema we want to use. The actual/current DB schema might differ
// until migrations are run.
var DbSchemaCurrent = DbSchemaCode
var DbSchemaCurrent = DbSchemaYuj
// There was a time when we had no schema at all.
const DbSchemaNone = ""
// DbSchemaCode is the first bee schema identifier
const DbSchemaCode = "code"
// DbSchemaYuj is the bee schema indentifier for storage incentives
// initial iteration.
const DbSchemaYuj = "yuj"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment