Skip to content

fix(cli): Migration helper prints undefined variable and missing input validation #4102

@Muawiya-contact

Description

@Muawiya-contact

crowd.dev edition

Community (self hosted)

Version

Latest (main branch)

What happened?

In scripts/cli, the create_migration() and
create_product_migration() functions have two bugs:

  1. Final output prints $MIG_FILE which is never defined —
    should be $UP_MIG_FILE and $DOWN_MIG_FILE
  2. No validation if migration name argument is empty,
    which silently creates broken files like V123456__ .sql

Command / Request

./scripts/cli create_migration

Relevant log output

Created  
# Empty output because $MIG_FILE is undefined
# Also creates a migration file with no name

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions