Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-31075

As a Maintainer I want to be able to upgrade database schema using a command

Details

    • Candidates for next sprint
    • 5

    Description

      It has been highly requested that database schema upgrade process is more smooth. Right now Developer needs to go into vendor/ezsystems/ezpublish-kernel/data/update directory and look for proper upgrade script. This is quite bad DX as there's a lot of combinations of upgrades (e.g. upgrading from 5.4 to 2.5, upgrading from 2.1. to 2.5, upgrading from 2.5 to 3.0@beta, etc.). In each case it can be confusing as to which upgrade scripts to run.

      We need a way to compare current schema with the available schema definition. With the introduction of eZ Systems Doctrine DBAL Schema (a.k.a. SchemaBuilder). It's much easier, because comparison can be done using Doctrine\DBAL\Schema tools.

      Spec:
      To be implemented as the ezplatform:upgrade:schema Symfony command.

      Usage: php ./bin/console ezplatform:upgrade:schema [options]
      Available options:

      • --dump-sql - output SQL to be executed,
      • --force - execute SQL,
      • --non-interactive (must be used together with --force).

      The schema comparison should be implemented by creating instances of live Schema (from Doctrine) and comparing it with an instance of Schema created by the Schema Builder. AFAIR Doctrine Schema tool already offers generating schema diff only.

      Note: this is about schema upgrade only, data upgrade should be explored separately, we might use Doctrine Migrations for this with our own DBMS-generic... touch

      Attachments

        Activity

          People

            Unassigned Unassigned
            andrew.longosz@ibexa.co Andrew Longosz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: