Skip to content

Bug: Migrate database when table users already exists #667

@felimalo

Description

@felimalo

PHP Version

8.1.6

CodeIgniter4 Version

4.3.1

Shield Version

1.0.0-beta.4

Which operating systems have you tested for this bug?

Linux

Which server did you use?

apache

Database

MySQL 5.7

Did you customize Shield?

No.

What happened?

I want to migrate from myth-auth to shield, but when I try to launch the migration of the database with spark migrate --all, it fails because I already have a table named users.

Steps to Reproduce

  1. Install the myth-auth package
  2. Do the migration with spark migrate --all
  3. Uninstall the package and install shield
  4. Try the migration with spark migrate --all

Expected Output

The expected output is that it does not fail, and it just does not create the already existing tables, like in version 1.0.0-beta.2. Then the migration from myth-auth to shield can be done manually with an other migration file which add new needed columns and remove old ones.

Anything else?

This behavior is due to the change on the second parameter of forge->createTable, which happened in MR #347.
As this second parameter is not deprecated (it's only the one of _createTable), it must be possible to add it again.

Thank you for all the work you made on CodeIgniter !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions