CodeIgniter Forums
Shield installation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Shield installation (/showthread.php?tid=89317)



Shield installation - Karstico - 02-05-2024

I'm following the steps in the tutorial:

https://shield.codeigniter.com/getting_started/install/

It seems to work but nothing is created in the database

  Run `spark migrate --all` now? [y, n]: y
Running all new migrations...
Migrations complete.

There are no errors in the proces, there are no migrations files on app\Database\Migrations. I dont know it should be.

I'm really lost here


RE: Shield installation - kenjis - 02-05-2024

If there is no errors, the installation has been completed.
The migration files locate in the Shield directory in the vendor directory.


RE: Shield installation - Karstico - 02-05-2024

(02-05-2024, 02:43 AM)kenjis Wrote: If there is no errors, the installation has been completed.
The migration files locate in the Shield directory in the vendor directory.

When the migration is executed, shouldn't the tables have been created? I tried it in project to test and I think the tables on the db were created with the spark shield:update


On migrateConfusedtatus the migration create_auth_tables appear but the tables are not on the db




RE: Shield installation - kenjis - 02-05-2024

(02-05-2024, 03:14 AM)Karstico Wrote: When the migration is executed, shouldn't the tables have been created?


Yes.

Code:
$ php spark migrate:status

CodeIgniter v4.4.3 Command Line Tool - Server Time: 2024-02-05 10:37:13 UTC+00:00

+----------------------+-------------------+---------------------+---------+---------------------+-------+
| Namespace            | Version          | Filename            | Group  | Migrated On        | Batch |
+----------------------+-------------------+---------------------+---------+---------------------+-------+
| CodeIgniter\Shield  | 2020-12-28-223112 | create_auth_tables  | default | 2023-12-27 11:52:21 | 1    |
| CodeIgniter\Settings | 2021-07-04-041948 | CreateSettingsTable | default | 2023-12-27 11:52:21 | 1    |
| CodeIgniter\Settings | 2021-11-14-143905 | AddContextColumn    | default | 2023-12-27 11:52:21 | 1    |
+----------------------+-------------------+---------------------+---------+---------------------+-------+

Code:
$ php spark db:table --show

CodeIgniter v4.4.3 Command Line Tool - Server Time: 2024-02-05 10:38:22 UTC+00:00

The following is a list of the names of all database tables:

+----+------------------------+-------------+---------------+
| ID | Table Name            | Num of Rows | Num of Fields |
+----+------------------------+-------------+---------------+
| 1  | migrations            | 3          | 7            |
| 2  | users                  | 2          | 9            |
| 3  | auth_identities        | 3          | 12            |
| 4  | auth_logins            | 0          | 8            |
| 5  | auth_token_logins      | 0          | 8            |
| 6  | auth_remember_tokens  | 0          | 7            |
| 7  | auth_groups_users      | 2          | 4            |
| 8  | auth_permissions_users | 0          | 4            |
| 9  | settings              | 0          | 8            |
+----+------------------------+-------------+---------------+



RE: Shield installation - Karstico - 03-15-2024

I'm here again

Code:
PS C:\xampp\htdocs\manmount> php spark migrate --all

CodeIgniter v4.4.6 Command Line Tool - Server Time: 2024-03-15 07:30:38 UTC+00:00

Running all new migrations...
Migrations complete.
PS C:\xampp\htdocs\manmount> php spark migrate:status

CodeIgniter v4.4.6 Command Line Tool - Server Time: 2024-03-15 07:30:42 UTC+00:00

+----------------------+-------------------+---------------------+-------+-------------+-------+
| Namespace            | Version          | Filename            | Group | Migrated On | Batch |
+----------------------+-------------------+---------------------+-------+-------------+-------+
| App                  | 2020-12-28-223112 | create_auth_tables  | ---  | ---        | ---  |
| CodeIgniter\Shield  | 2020-12-28-223112 | create_auth_tables  | ---  | ---        | ---  |
| CodeIgniter\Settings | 2021-07-04-041948 | CreateSettingsTable | ---  | ---        | ---  |
| CodeIgniter\Settings | 2021-11-14-143905 | AddContextColumn    | ---  | ---        | ---  |
+----------------------+-------------------+---------------------+-------+-------------+-------+

PS C:\xampp\htdocs\manmount> php spark db:table --show

CodeIgniter v4.4.6 Command Line Tool - Server Time: 2024-03-15 07:30:45 UTC+00:00

The following is a list of the names of all database tables:

+----+------------+-------------+---------------+
| ID | Table Name | Num of Rows | Num of Fields |
+----+------------+-------------+---------------+
| 1  | config    | 0          | 14            |
| 2  | migrations | 0          | 7            |
| 3  | pages      | 8          | 20            |
+----+------------+-------------+---------------+
I dont understand why this happens


RE: Shield installation - kenjis - 03-15-2024

It seems your migration files are not executed at all.
I don't know why.

Is there any error in CI4 log file?


RE: Shield installation - Karstico - 03-15-2024

(03-15-2024, 12:39 AM)kenjis Wrote: It seems your migration files are not executed at all.
I don't know why.

Is there any error in CI4 log file?

No errors in the log


RE: Shield installation - kenjis - 03-15-2024

Then, there is no error, but your migration files are not executed at all. Weird.

Why do you have two `create_auth_tables`?

| App                  | 2020-12-28-223112 | create_auth_tables  | ---  | ---        | ---  |
| CodeIgniter\Shield  | 2020-12-28-223112 | create_auth_tables  | ---  | ---        | ---  |


RE: Shield installation - Karstico - 03-15-2024

I dont know, maybe i copied it trying some fix. I delete it now but i got the same

Code:
PS C:\xampp\htdocs\manmount> php spark migrate --all

CodeIgniter v4.4.6 Command Line Tool - Server Time: 2024-03-15 08:07:52 UTC+00:00

Running all new migrations...
Migrations complete.
PS C:\xampp\htdocs\manmount> php spark db:table --show

CodeIgniter v4.4.6 Command Line Tool - Server Time: 2024-03-15 08:07:58 UTC+00:00

The following is a list of the names of all database tables:

+----+------------+-------------+---------------+
| ID | Table Name | Num of Rows | Num of Fields |
+----+------------+-------------+---------------+
| 1  | config     | 0           | 14            |
| 2  | migrations | 0           | 7             |
| 3  | pages      | 8           | 20            |
+----+------------+-------------+---------------+


PS C:\xampp\htdocs\manmount> php spark migrate:status

CodeIgniter v4.4.6 Command Line Tool - Server Time: 2024-03-15 08:08:03 UTC+00:00

+----------------------+-------------------+---------------------+-------+-------------+-------+
| Namespace            | Version           | Filename            | Group | Migrated On | Batch |
+----------------------+-------------------+---------------------+-------+-------------+-------+
| CodeIgniter\Shield   | 2020-12-28-223112 | create_auth_tables  | ---   | ---         | ---   |
| CodeIgniter\Settings | 2021-07-04-041948 | CreateSettingsTable | ---   | ---         | ---   |
| CodeIgniter\Settings | 2021-11-14-143905 | AddContextColumn    | ---   | ---         | ---   |
+----------------------+-------------------+---------------------+-------+-------------+-------+



RE: Shield installation - kenjis - 03-15-2024

Did you disable migration?
See https://github.com/codeigniter4/CodeIgniter4/blob/58aa7326bce6e040ebcaf6f318f966d3d2c6c233/app/Config/Migrations.php#L19