(ctx context.DnoteCtx)
| 256 | } |
| 257 | |
| 258 | func getUnrunMigrations(ctx context.DnoteCtx) ([]int, error) { |
| 259 | var ret []int |
| 260 | |
| 261 | schema, err := readSchema(ctx) |
| 262 | if err != nil { |
| 263 | return ret, errors.Wrap(err, "Failed to read schema") |
| 264 | } |
| 265 | |
| 266 | log.Debug("current legacy schema: %d\n", schema.CurrentVersion) |
| 267 | |
| 268 | if schema.CurrentVersion == len(migrationSequence) { |
| 269 | return ret, nil |
| 270 | } |
| 271 | |
| 272 | nextVersion := schema.CurrentVersion |
| 273 | ret = migrationSequence[nextVersion:] |
| 274 | |
| 275 | return ret, nil |
| 276 | } |
| 277 | |
| 278 | func updateSchemaVersion(ctx context.DnoteCtx, mID int) error { |
| 279 | s, err := readSchema(ctx) |
no test coverage detected