Skip to content
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

Allow DBMigrationHook to migrate sqlite databases #5220

Open
moreamazingnick opened this issue May 16, 2024 · 0 comments
Open

Allow DBMigrationHook to migrate sqlite databases #5220

moreamazingnick opened this issue May 16, 2024 · 0 comments

Comments

@moreamazingnick
Copy link
Contributor

moreamazingnick commented May 16, 2024

Is your feature request related to a problem? Please describe.

I use sqlite3 dababases to start developing and later in a more mature state move to mysql.
I recently got familiar with the DbMigrationHook an realized that it wants to use the mysql-upgrades folder for upgrades on sqlite databases with is not correct.

Describe the solution you'd like

A clear and concise description of what you want to happen.

        if ($this->getDb()->getAdapter() instanceof Pgsql) {
            $upgradeDir = static::PGSQL_UPGRADE_DIR;
        }elseif($this->getDb()->getAdapter() instanceof Sqlite){
            $upgradeDir = static::SQLITE_UPGRADE_DIR;
        }else{
            $upgradeDir = static::MYSQL_UPGRADE_DIR;
        }

Also

  • MigrationManager->checkRequiredPrivileges()
  • DbMigrationHook->tableExists()
  • DbMigrationHook->getColumnType()

need to be adapted.

Describe alternatives you've considered

Override the load() function but that would lead to code duplication

Additional context

I'm happy to provide a merge request.

Best Regards and thanks in advance

Nicolas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant