FOUR-12173: Develop Wizard Template database schema by estebangallego · Pull Request #5706 · ProcessMaker/processmaker

Summary

This pull request introduces two migrations to enhance the database schema. The changes include:

  1. Migration to Add a asset_type to process_templates:

    • Added a new migration file (add__asset_type_column_to_process_templates) to insert a string column after the existing is_system column in the process_templates table.
  2. Migration for wizard_templates Table:

    • Created a migration file (create_wizard_templates_table) to define the schema for the wizard_templates table.
    • Included columns such as id, uuid, process_template_id, process_id, media_id, and timestamps.
    • Defined foreign key constraints for process_id and media_id columns.

Reason for the Changes

The additions to the database schema were necessary to accommodate new requirements and improve data management for the development of Wizard Templates.

Checklist

  • New column added to process_templates table.
  • Create wizard_templates table with appropriate foreign key constraints.

Testing

  1. Migration Stability:

    • Run the migration multiple times to ensure it runs without errors.
    • Confirm successful rollback operations.
    • php artisan migrate
    • php artisan migrate:rollback --step=2
  2. wizard_templates Table:

    • Verify successful creation and deletion during rollback.
    • Confirm correct column data types and foreign key constraints.
  3. process_templates Table:

    • Confirm the addition of the new string column (asset_type or actual name) after is_system.
    • Verify the data type and nullability of the new column.
  4. Rollback Effects:

    • Ensure wizard_templates deletion and process_templates rollback to the previous state.

These steps cover essential aspects of migration stability, table and column creation, rollback effects, and functional verification. Adjust the steps based on your specific requirements.

Related Issues

Ticket FOUR-12173

Screenshots

Screenshot 2023-11-28 at 11 04 10 AM


Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.