Remove migrate:begin/commit/rollback references, unify to migrate command
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -393,17 +393,14 @@ COMMANDS
|
||||
Main migration command. Runs the full cycle:
|
||||
pre-normalize → migrations → post-normalize → regenerate constants (dev)
|
||||
|
||||
### php artisan migrate:begin
|
||||
Creates MySQL snapshot before migrations (dev mode only).
|
||||
Required for safety in development.
|
||||
In development mode:
|
||||
- Automatically creates database snapshot before migrations
|
||||
- On success: commits changes, removes snapshot, regenerates constants/bundles
|
||||
- On failure: automatically rolls back to snapshot
|
||||
|
||||
### php artisan migrate:commit
|
||||
Deletes snapshot and exits migration mode.
|
||||
Runs schema quality checks before committing.
|
||||
|
||||
### php artisan migrate:rollback
|
||||
Restores database to snapshot state.
|
||||
Stays in migration mode for retry.
|
||||
In debug/production mode:
|
||||
- Runs migrations directly without snapshot protection
|
||||
- Does NOT update source code (constants, bundles)
|
||||
|
||||
### php artisan migrate:normalize_schema
|
||||
Manually run normalization (rarely needed).
|
||||
@@ -415,15 +412,16 @@ COMMANDS
|
||||
|
||||
SNAPSHOT-BASED DEVELOPMENT
|
||||
--------------------------
|
||||
Development migrations require snapshots for safety:
|
||||
In development mode, the migrate command handles snapshots automatically:
|
||||
|
||||
1. `php artisan migrate:begin` - Create snapshot
|
||||
2. `php artisan migrate` - Run migrations
|
||||
3. `php artisan migrate:commit` - Keep changes, delete snapshot
|
||||
OR
|
||||
`php artisan migrate:rollback` - Discard changes, restore snapshot
|
||||
1. `php artisan migrate` - Does everything:
|
||||
- Creates snapshot before running
|
||||
- Runs all pending migrations
|
||||
- On success: commits snapshot, regenerates constants
|
||||
- On failure: rolls back to snapshot automatically
|
||||
|
||||
Production migrations skip snapshots and run directly.
|
||||
No manual snapshot management is needed. Just run `migrate` and the framework
|
||||
handles safety automatically.
|
||||
|
||||
WHY NO FOREIGN KEY DROP/RECREATE?
|
||||
---------------------------------
|
||||
|
||||
Reference in New Issue
Block a user