You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package includes CycleORM commands implemented as Laravel Console Commands, you can use them to manage your database schema and perform migrations.
7
+
8
+
The package extends Laravel's artisan commands, introducing a set of commands specifically designed for managing CycleORM migrations and database schema. These commands are intuitive for Laravel developers and follow the framework's conventions.
This package includes CycleORM commands implemented as Laravel Console Commands, you can use them to manage your database schema and perform migrations.
4
-
5
-
The package extends Laravel's artisan commands, introducing a set of commands specifically designed for managing CycleORM migrations and database schema. These commands are intuitive for Laravel developers and follow the framework's conventions.
6
-
7
-
8
-
## 🛠️ Commands for Migrations
4
+
# Migration Commands
9
5
10
6
Migration commands are essential for managing your database's evolution over time. They allow for the creation, execution, rollback, and status checking of migrations.
This command is your starting point for migration management. It initializes the migration system by creating the necessary migrations table in your database, ensuring that you can start tracking and executing migrations.
To apply pending migrations to your database, use the `cycle:migrate` command. This will execute all migrations that have not yet been applied, updating your database schema accordingly.
40
59
41
-
#### Usage:
60
+
#### Usage
42
61
43
62
```bash
44
63
php artisan cycle:migrate
45
64
```
46
65
47
-
#### Options:
66
+
#### Options
48
67
49
68
`--one`: Executes only the first pending migration, allowing for more granular control over the migration process.
50
69
@@ -54,13 +73,13 @@ php artisan cycle:migrate
54
73
55
74
This command facilitates the replaying of migrations by first rolling them back and then re-applying them. It's particularly useful for development environments where you need to quickly test changes to migrations.
56
75
57
-
#### Usage:
76
+
#### Usage
58
77
59
78
```bash
60
79
php artisan cycle:migrate:replay
61
80
```
62
81
63
-
#### Options:
82
+
#### Options
64
83
65
84
`--all`: Replays all migrations, effectively refreshing your entire database schema.
To undo the last batch of migrations, you can use the `cycle:migrate:rollback` command. This is useful when you need to revert changes made by the most recent migrations.
73
92
74
-
#### Usage:
93
+
#### Usage
75
94
76
95
```bash
77
96
php artisan cycle:migrate:rollback
78
97
```
79
98
80
-
#### Options:
99
+
#### Options
81
100
82
101
`--all`: Rolls back all migrations, allowing you to revert your database schema to its initial state.
Keeping track of which migrations have been applied is crucial for database management. The `cycle:migrate:status` command displays the status of all migrations, indicating which have been applied and which are pending.
When you need to start from a clean slate, the `cycle:migrate:fresh` command drops all tables from the database and re-runs all migrations. This is particularly useful for resetting the database to a known state during development or testing.
0 commit comments