spiral / cycle-bridge

🌉 Cycle ORM v2 bridge to Spiral Framework
https://cycle-orm.dev
MIT License
16 stars 6 forks source link

Migration commands refactoring #83

Closed butschster closed 10 months ago

butschster commented 10 months ago

We've made some exciting improvements to the Spiral Framework's Cycle Bridge! Check out what's new:

1. Separate Migrations for Each Entity:

We've added a split option to the cycle:migrate command. Now, when you run

php app.php cycle:migrate -p

it will create individual migrations for each entity.

This means if you have changes in different entity schemas, each entity will get its own specific migration. Super handy for organizing your database updates!

2. Prompt for Pending Migrations:

If there are migrations you haven't completed yet, using cycle:migrate will now prompt you with a choice.

When you run

php app.php cycle:migrate

it will ask if you want to execute these outstanding migrations right away like in the example below:

Outstanding migrations found.

Do you want to run `migrate` now? (yes/no) [yes]:
>

You can use option --no-interaction or -n to omit this question.

php app.php cycle:migrate --no-interaction

3. Safety Check for cycle:sync:

To prevent accidental execution in production, we've added a confirmation step for the cycle:sync command.

When you try

php app.php cycle:sync

in a production environment, it will now ask for your confirmation before proceeding:

This operation is not recommended for production environment.

Would you like to continue? (yes/no) [no]:
>

This extra step helps avoid unintended changes in your live environment.

4. Default 'No' for Critical Commands in Production:

For added security, commands that require environmental checks and confirmations to continue in a production setting will now have no as the default option. This means if you accidentally hit enter, it won't proceed unless you explicitly type yes. A small change, but a big win for avoiding unintended actions!

5. Improved Console Messages:

We've also tweaked some of the messages you see in the console for better clarity and user experience.


We're excited about these updates and believe they will make managing your Spiral projects even smoother. As always, we appreciate your feedback and contributions!

issue #82

msmakouz commented 10 months ago

@butschster Pay attention to the tests. (All checks have failed)