Add support for treating Metafield/Metaobject definitions as a database schema #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a migration framework for the Shopify Toolkit, enabling the management of migrations through a set of commands and supporting classes. The key changes include adding command-line tasks for migrations, implementing a
Migration
base class, and creating aMigrator
class to handle migration execution and metadata management.Command-line enhancements:
migrate
,down
,redo
) to run migrations up, down, or redo them, utilizing theShopifyToolkit::Migrator
class. (lib/shopify_toolkit/command_line.rb
, lib/shopify_toolkit/command_line.rbR56-R73)Migration framework:
ShopifyToolkit::Migration
base class with methods for definingup
anddown
migrations, logging, and handling migration directions. (lib/shopify_toolkit/migration.rb
, lib/shopify_toolkit/migration.rbR1-R63)IrreversibleMigration
exception. (lib/shopify_toolkit/migration.rb
, lib/shopify_toolkit/migration.rbR1-R63)Migration execution and metadata management:
ShopifyToolkit::Migrator
class to load, execute, and manage migrations, including metafield-based storage of migrated versions for tracking state. (lib/shopify_toolkit/migrator.rb
, lib/shopify_toolkit/migrator.rbR1-R152)MigrationProxy
to defer loading of migration classes until needed, improving efficiency and modularity. (lib/shopify_toolkit/migrator.rb
, lib/shopify_toolkit/migrator.rbR1-R152)