Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mybee
Commits
8481cd7c
Unverified
Commit
8481cd7c
authored
May 05, 2021
by
acud
Committed by
GitHub
May 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localstore: add breaking migration (#1610)
parent
4c74b592
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
migration.go
pkg/localstore/migration.go
+4
-1
schema.go
pkg/localstore/schema.go
+5
-1
No files found.
pkg/localstore/migration.go
View file @
8481cd7c
...
...
@@ -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
{
...
...
pkg/localstore/schema.go
View file @
8481cd7c
...
...
@@ -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
=
DbSchema
Code
var
DbSchemaCurrent
=
DbSchema
Yuj
// 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"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment