wrenchUpgrade Notes

This guide details the changes needed when upgrading from Sketch v1.x to v2.0.0. The new version introduces significant architectural improvements and changes to the YAML schema structure.

Configuration Changes

If you have published the configuration file, you will need to republish it:

php artisan vendor:publish --provider="Daycode\Sketch\SketchServiceProvider" --force

YAML Schema Changes

Relationships Definition

New Release Belongs to Many Relationships

relationships:
    - {
        type: belongsToMany,
        model: Role,
        pivotTable: user_roles,
        pivotTableKeyType: uuid,
        foreignPivot: {
          table: users,
          key: user_id,
          type: uuid,
          references: id
        },
        relatedPivot: {
          table: roles,
          key: role_id,
          type: id,
          references: id
        },
        pivotColumns: [
          { name: expires_at, type: timestamp, nullable: true },
          { name: active, type: boolean, nullable: false }
        ],
        withTimestamps: true
    }

Regular Relationships

Previous format (v1.x):

New format (v2.0.0):

Directory Structure Changes

The new version generates additional directories and files for the service repository pattern:

Command Changes

The generate command now includes additional options for service repository generation:

Migration Steps

  1. Update all your existing YAML schema files to follow the new relationship format.

  2. Regenerate your models and migrations using the new command options.

  3. If you want to take advantage of the service repository pattern:

    1. Add the --service-repository flag when you want to generate service repository class

    2. Update your controllers to use the service layer instead of direct model access

Important Notes

  • Form request validation now includes support for pivot table fields

  • The Action class generation has been replaced with the service repository pattern

  • The new version provides more explicit control over foreign key relationships

  • UUID and ULID support has been enhanced across all components

If you encounter any issues during the upgrade process, please refer to our GitHub issues page or contact our support team.

Last updated