You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
updated the structure to address the versioning and the order of the migrations registered, add the metadata.applied_migrations object to be able to trace the applied MigrationTrace
- The `<order>` integer is used to determine the order of migrations for the same version.
9
+
- Name the file using the pattern: `<description_of_the_migration>.py`.
10
+
- Example: `http_requester_url_base_to_url.py`
11
+
- The filename should be unique and descriptive.
12
12
13
13
2.**Define the Migration Class:**
14
14
- The migration class must inherit from `ManifestMigration`.
15
-
- Name the class using the pattern: `V_<major>_<minor>_<patch>_<Description>`.
16
-
- Example: `V_6_45_2_HttpRequesterUrlBaseToUrl`
15
+
- Name the class using a descriptive name (e.g., `HttpRequesterUrlBaseToUrl`).
17
16
- Implement the following methods:
18
-
-`should_migrate(self, manifest: ManifestType) -> bool`: Return `True` if the migration should be applied to the given manifest.
19
-
-`migrate(self, manifest: ManifestType) -> None`: Perform the migration in-place.
20
-
21
-
3.**Migration Versioning:**
22
-
- The migration version is extracted from the class name and used to determine applicability.
23
-
- Only manifests with a version less than or equal to the migration version will be migrated.
24
-
25
-
4.**Component Type:**
26
-
- Use the `TYPE_TAG` constant to check the component type in your migration logic.
27
-
28
-
5.**Examples:**
29
-
- See `migrations/http_requester_url_base_to_url_v6_45_2__0.py` and `migrations/http_requester_path_to_url_v6_45_2__1.py` for reference implementations.
30
-
31
-
## Migration Registry
32
-
33
-
- All migration classes in the `migrations/` folder are automatically discovered and registered in `migrations_registry.py`.
34
-
- Migrations are applied in order, determined by the `<order>` suffix in the filename.
35
-
36
-
## Testing
37
-
38
-
- Ensure your migration is covered by unit tests.
39
-
- Tests should verify both `should_migrate` and `migrate` behaviors.
0 commit comments