Skip to content

lb4 relation should discard changes when something failed #3287

@ErwSim

Description

@ErwSim

Suggestion

When something failed (ie: no pk or property already exists), changes that have been applied should be discarded

Use Cases

It would permit to avoid reverting manually changes since the command has failed

Examples

lb4 relation

fill
an error has occured
should be revert back

Acceptance criteria

  • Do not generate any code if the the generation fails or gets aborted.
  • stretch goal: warn users earlier about missing Repository class (perhaps at the point right after asking for target and source model).
  • stretch goal: warn users when they are using customized FK name.
    • use customized foreign key name for belongsTo relation ( myCustomer in this case).
    • use customized source property name for hasMany relation (e.g myOrder instead of orders).
      because our the CLI doesn't support customizing names atm.
  • Update documentation if there is behaviour change for prompts.

Metadata

Metadata

Assignees

Labels

CLIRelationsModel relations (has many, etc.)developer-experienceIssues affecting ease of use and overall experience of LB users

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions