Skip to content

[Research] Support Doctrine Migrations  #13820

Closed

Description

@DeepDiver1975

http://www.doctrine-project.org/api/migrations/2.0/class-Doctrine.DBAL.Migrations.AbstractMigration.html

Implementing Migrations like this is a common approach which is used across frameworks and programming languages - we should have a look on how we can stream line or database migrations with respect to using mainstream technologies.

Activity

  1. DeepDiver1975 commented on Feb 2, 2015

    @DeepDiver1975
    ContributorAuthor
  2. added this to the backlog milestone on Mar 1, 2016
  3. PVince81 commented on Apr 19, 2016

    @PVince81
    Contributor

    One of the concerns mentioned by @karlitschek about doctrine migrations is that it removes the "easy of use" for app developers, because writing migration code can be more tricky than just changing an XML file. An idea to get around this would be to provide a command "occ generate-migration-code" that reads the old and updated XML files and automatically generates the PHP code that matches the changes based on the diff. This means that app developers could still use the old approach, but would be required to run an additional command to generate the PHP code.

  4. DeepDiver1975 commented on Apr 19, 2016

    @DeepDiver1975
    ContributorAuthor

    We anyhow need to support the xml based schema for quite some releases after introduction of migrations. As a result we can simply continue to support the xml based approach for apps in case they want to do it the easy way.

    A switch in the app info xml could be used to explicitly enable migrations.

  5. karlitschek commented on Apr 19, 2016

    @karlitschek
    Contributor

    Yes. Maybe supporting both in the best option. We can use the xml schema for the simple cases and apps. And we could support 'manual' migration for the complex cases where it is really needed and the developer knows exactly what they are doing.

  6. DeepDiver1975 commented on Apr 19, 2016

    @DeepDiver1975
    ContributorAuthor

    I see main benefit of migrations for complex scenarios - which will in most cases be core and core related apps.

    Just to give an understanding for everybody on where migrations have a greater power compared to your xml schema:

    complex schema changes

    Let's say there is a table (let's name it oc_activities) and we want to change a column from varchar(4000) to clob.
    On Oracle we need to create new table, move data, delete old table, rename - https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1770086700346491686

    Ability to downgrade

    Doctrine Migrations have the capabilities to move back and forth with individual steps.
    This is on one hand very helpful for developers to test migrations but on the otherhand will give us the capabilities to allow a full downgrade after e.g. an upgrade failure.

    Upgrade over multiple major releases

    Because migrations are a constant stream of changes we could realize upgrade over multiple major releases.

  7. DeepDiver1975 commented on Apr 19, 2016

    @DeepDiver1975
    ContributorAuthor

    To some extend this has an impact on the current work of #24085 where repairsteps will be used for apps to execute additional migration steps before and after db schema migration.

    Once introduced they collide with the upgrade and downgrade capabilities of migrations - repairsteps only move in one direction - they have no downgrade capability.

  8. modified the milestones: , backlog on Apr 25, 2016
  9. DeepDiver1975 commented on Apr 25, 2016

    @DeepDiver1975
    ContributorAuthor

    @karlitschek @PVince81 since we are talking about an optional mechanism - would it make sense to push fir this in 9.1 to at least have the basic foundation in place?

  10. karlitschek commented on Apr 25, 2016

    @karlitschek
    Contributor

    @DeepDiver1975 Sure. Once we have all the other prio1 and prio2 9.1 tasks finished. @cmonteroluque

  11. MTRichards commented on Apr 25, 2016

    @MTRichards
    Contributor

    Concur, 9.2. Tagged as such.

  12. PVince81 commented on Dec 12, 2016

    @PVince81
    Contributor

    @DeepDiver1975 the doctrine migrations PR was tested and merged #14851. Is there anything left to do ? If not, please close all relevant tickets. Thanks.

  13. lock commented on Aug 3, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  14. locked as resolved and limited conversation to collaborators on Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions