-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the -g
option in spark migrate
for?
#7891
Comments
The migration specifications are not clear, but my understanding is as follows:
Is there something wrong? > @codeigniter4/database-team |
@kenjis All 3 points are valid.
I believe the lack of this parameter should execute all migrations. |
Okay, then the description in the user guide is wrong?
|
I think so. |
Okay, it seems the current behavior is fine. And the bug is only in the docs. If you don't specify $ php spark migrate:status
CodeIgniter v4.4.0 Command Line Tool - Server Time: 2023-09-04 05:47:49 UTC+00:00
+-----------+-------------------+----------------+-------+-------------+-------+
| Namespace | Version | Filename | Group | Migrated On | Batch |
+-----------+-------------------+----------------+-------+-------------+-------+
| App | 2023-09-04-013453 | DefaultAddBlog | --- | --- | --- |
| App | 2023-09-04-013454 | Test1AddBlog | --- | --- | --- |
| App | 2023-09-04-013455 | Test2AddBlog | --- | --- | --- |
+-----------+-------------------+----------------+-------+-------------+-------+ $ php spark migrate
CodeIgniter v4.4.0 Command Line Tool - Server Time: 2023-09-04 05:48:00 UTC+00:00
Running all new migrations...
Running: (App) 2023-09-04-013453_App\Database\Migrations\DefaultAddBlog
Running: (App) 2023-09-04-013454_App\Database\Migrations\Test1AddBlog
Running: (App) 2023-09-04-013455_App\Database\Migrations\Test2AddBlog
Migrations complete. $ php spark migrate:status
CodeIgniter v4.4.0 Command Line Tool - Server Time: 2023-09-04 05:48:04 UTC+00:00
+-----------+-------------------+----------------+---------+---------------------+-------+
| Namespace | Version | Filename | Group | Migrated On | Batch |
+-----------+-------------------+----------------+---------+---------------------+-------+
| App | 2023-09-04-013453 | DefaultAddBlog | default | 2023-09-04 05:48:00 | 1 |
| App | 2023-09-04-013454 | Test1AddBlog | test1 | 2023-09-04 05:48:00 | 1 |
| App | 2023-09-04-013455 | Test2AddBlog | test2 | 2023-09-04 05:48:00 | 1 |
+-----------+-------------------+----------------+---------+---------------------+-------+ If you specify $ php spark migrate:status
CodeIgniter v4.4.0 Command Line Tool - Server Time: 2023-09-04 05:48:10 UTC+00:00
+-----------+-------------------+----------------+-------+-------------+-------+
| Namespace | Version | Filename | Group | Migrated On | Batch |
+-----------+-------------------+----------------+-------+-------------+-------+
| App | 2023-09-04-013453 | DefaultAddBlog | --- | --- | --- |
| App | 2023-09-04-013454 | Test1AddBlog | --- | --- | --- |
| App | 2023-09-04-013455 | Test2AddBlog | --- | --- | --- |
+-----------+-------------------+----------------+-------+-------------+-------+ $ php spark migrate -g default
CodeIgniter v4.4.0 Command Line Tool - Server Time: 2023-09-04 05:49:02 UTC+00:00
Running all new migrations...
Running: (App) 2023-09-04-013453_App\Database\Migrations\DefaultAddBlog
Migrations complete. $ php spark migrate:status
CodeIgniter v4.4.0 Command Line Tool - Server Time: 2023-09-04 05:49:05 UTC+00:00
+-----------+-------------------+----------------+---------+---------------------+-------+
| Namespace | Version | Filename | Group | Migrated On | Batch |
+-----------+-------------------+----------------+---------+---------------------+-------+
| App | 2023-09-04-013453 | DefaultAddBlog | default | 2023-09-04 05:49:02 | 1 |
| App | 2023-09-04-013454 | Test1AddBlog | --- | --- | --- |
| App | 2023-09-04-013455 | Test2AddBlog | --- | --- | --- |
+-----------+-------------------+----------------+---------+---------------------+-------+ If you specify $ php spark migrate -g test2
CodeIgniter v4.4.0 Command Line Tool - Server Time: 2023-09-04 05:49:21 UTC+00:00
Running all new migrations...
Running: (App) 2023-09-04-013455_App\Database\Migrations\Test2AddBlog
Migrations complete. $ php spark migrate:status
CodeIgniter v4.4.0 Command Line Tool - Server Time: 2023-09-04 05:49:23 UTC+00:00
+-----------+-------------------+----------------+---------+---------------------+-------+
| Namespace | Version | Filename | Group | Migrated On | Batch |
+-----------+-------------------+----------------+---------+---------------------+-------+
| App | 2023-09-04-013453 | DefaultAddBlog | default | 2023-09-04 05:49:02 | 1 |
| App | 2023-09-04-013454 | Test1AddBlog | --- | --- | --- |
| App | 2023-09-04-013455 | Test2AddBlog | test2 | 2023-09-04 05:49:21 | 2 |
+-----------+-------------------+----------------+---------+---------------------+-------+ If you specify $ php spark migrate -g test1
CodeIgniter v4.4.0 Command Line Tool - Server Time: 2023-09-04 05:49:33 UTC+00:00
Running all new migrations...
Running: (App) 2023-09-04-013454_App\Database\Migrations\Test1AddBlog
Migrations complete. $ php spark migrate:status
CodeIgniter v4.4.0 Command Line Tool - Server Time: 2023-09-04 05:49:34 UTC+00:00
+-----------+-------------------+----------------+---------+---------------------+-------+
| Namespace | Version | Filename | Group | Migrated On | Batch |
+-----------+-------------------+----------------+---------+---------------------+-------+
| App | 2023-09-04-013453 | DefaultAddBlog | default | 2023-09-04 05:49:02 | 1 |
| App | 2023-09-04-013454 | Test1AddBlog | test1 | 2023-09-04 05:49:33 | 3 |
| App | 2023-09-04-013455 | Test2AddBlog | test2 | 2023-09-04 05:49:21 | 2 |
+-----------+-------------------+----------------+---------+---------------------+-------+ |
Great, thanks! |
Closed by #7894 |
Migration of non-default group is also executed without the
-g
option.How to Reproduce
References
spark migrate
issue with -g option #7846The text was updated successfully, but these errors were encountered: