Re: db migrator

From: tobias.schoessle..nodc.org
Date: Wed Oct 17 2007 - 19:08:06 EDT

  • Next message: Tore Halset: "Re: db migrator"

    very nice. Is there any chance to see this driven from the other side round too. Like changes to the DB have 'Reverse Engineer Database schema' merge changes into the existing mapping in the modeller.
    I am craving for this for some time.

    Tore Halset <halse..vv.ntnu.no> wrote:
    Hello.

    I want to be able to migrate schema changes from a DataMap to a
    database. Mainly for two reasons.
      1) Make it easier for DBAs and developers to keep track of DB
    related changes in a project.
      2) Make it simpler for developers to keep the db schema in sync
    with the model.

    My current implementation has support for adding tables, add/drop
    columns, setting null/not null and changing text length. The unit
    tests works on PostgreSQL, MS SQL Server and Derby.

    Implementation details:
      * Each DbAdapter can create a DbMergerFactory that are able to
    create DbMergerToken for various tasks like AddColumn and SetAllowNull.
      * A DbMerger class that uses DbLoader to create a DataMap from the
    db and then create a List of needed DbMergerTokens that can be
    applied to the database to get in sync.

    Here are some screenshots from the modeler.
    http://www.pvv.ntnu.no/~halset/tmp/caymigr/

    TODO:
      * Support more databases. Will need help on this one as I do not
    have access to that many.
      * Default value for not null columns.
      * Support more tasks like adding/dropping forreign keys, changing
    primary keys and so on.

    We have discussed this before, but I am not able to find a suitable
    jira task for it.

    Is this something you want for cayenne as well? Is it ok for you if I
    start checking in after M2?

    Regards,
      - Tore.

    ___
     sent via WebmailLight 3.1.11



    This archive was generated by hypermail 2.0.0 : Thu Oct 18 2007 - 01:39:39 EDT