Commit 81d3322
committed
Add support for schema downgrade migrations
This change introduces the ability to downgrade metadata schemas to recent
versions, allowing for more flexible schema version management.
Key changes:
- Allow migration to version 0.6.10 in addition to the current version
- Implement SIMPLE_DOWNGRADES mechanism for safe field removal during downgrade
- Remove restriction preventing downgrade to lower schema versions
- Add validation to prevent data loss when downgrading with populated fields
- Add comprehensive tests for downgrade functionality with releaseNotes field
The downgrade mechanism ensures data integrity by raising an error if a field
being removed during downgrade contains a non-empty value.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Conflicts:
dandischema/metadata.py -- both wanted to always set schema version to migrated-to
dandischema/tests/test_metadata.py -- just added tests conflicted placement1 parent 7063e44 commit 81d3322
3 files changed
+68
-40
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | 361 | | |
368 | 362 | | |
369 | 363 | | |
370 | 364 | | |
371 | | - | |
372 | | - | |
| 365 | + | |
| 366 | + | |
373 | 367 | | |
374 | | - | |
| 368 | + | |
375 | 369 | | |
376 | 370 | | |
377 | 371 | | |
378 | | - | |
| 372 | + | |
379 | 373 | | |
380 | 374 | | |
381 | 375 | | |
| |||
384 | 378 | | |
385 | 379 | | |
386 | 380 | | |
387 | | - | |
| 381 | + | |
388 | 382 | | |
389 | 383 | | |
390 | 384 | | |
391 | 385 | | |
392 | 386 | | |
393 | 387 | | |
394 | | - | |
| 388 | + | |
395 | 389 | | |
396 | 390 | | |
397 | | - | |
| 391 | + | |
398 | 392 | | |
399 | 393 | | |
400 | 394 | | |
| |||
407 | 401 | | |
408 | 402 | | |
409 | 403 | | |
410 | | - | |
| 404 | + | |
411 | 405 | | |
412 | 406 | | |
413 | 407 | | |
| |||
424 | 418 | | |
425 | 419 | | |
426 | 420 | | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | 421 | | |
433 | 422 | | |
434 | 423 | | |
435 | | - | |
| 424 | + | |
436 | 425 | | |
437 | 426 | | |
438 | 427 | | |
439 | | - | |
| 428 | + | |
440 | 429 | | |
441 | 430 | | |
442 | | - | |
| 431 | + | |
443 | 432 | | |
444 | 433 | | |
445 | 434 | | |
| |||
459 | 448 | | |
460 | 449 | | |
461 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
462 | 469 | | |
463 | 470 | | |
464 | 471 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | 427 | | |
442 | 428 | | |
443 | 429 | | |
| |||
509 | 495 | | |
510 | 496 | | |
511 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
512 | 534 | | |
513 | 535 | | |
514 | 536 | | |
| |||
0 commit comments