Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Database > Database APIs

    nous.migration 0.7.1

    Download button

    No screenshots available
    Downloads: 234  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Ignas Mikalajunas | More programs
    GPL / FREE
    March 13th, 2012, 05:20 GMT
    ROOT / Database / Database APIs

     Read user reviews (0)  Refer to a friend  Subscribe

    nous.migration description

    Yet another SQLAlchemy based database schema migration tool

    nous.migration is yet another SQLAlchemy based database schema migration tool.

    Installation

    To install it, add:

    [migration]
    recipe = zc.recipe.egg
    eggs=
      nous.migration


    to your buildout.cfg

    You might want to add your databse driver pakcage and your application
    package like this:

    [migration]
    recipe = zc.recipe.egg
    eggs=
      psycopg2
      nous.some_app
      nous.migration


    Configuration

    Add to your development.ini or some other kind of ini:

    [nous.migration]
    app = app:busy
    package = busy.migration


    migrator expects sqlalchemy configuration to be present in the app section, for example:

    [app:busy]
    sqlalchemy.url = postgresql:///development


    I might add sqlalchemy configuration to the migration section too if someone will ask.

    You can also add:

    vcs = git
    schema_diff_cmd = git diff src/busy/models/schema.sql


    so that add_script command would add the files to the version control system, and populate them with the delta of your schema automatically.

    These two settings might go the setup.cfg as they are not really deployment related and are never required to run your application.

    Usage

    bin/migrate development.ini [upgrade|downgrade|setup|add_script] [version]

    Integrating with your application

    Add something like this:

        engine = engine_from_config(conf, 'sqlalchemy.')
        DBMigrator(engine, 'busy.migration').set_up_migration(init_migration=DBSetUp(), run_scripts=False)


    to your setup_app, or in your initialize_sql

    DBSetUp is a class that has an "upgrade" method that initializes your schema.

    You can do it in multiple ways, you can add a migration script that sets up your tables and then migrate that using migration scripts:

        DBMigrator(engine, 'busy.migration').set_up_migration(run_scripts=True)

    Or you can have a canonical schema set up and initialize it all at once and just mark all the scripts as 'done'

        DBMigrator(engine, 'busy.migration').set_up_migration(init_migration=DBSetUp(), run_scripts=False)


    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    database schema | schema migration | SQLAlchemy migration | SQLAlchemy | database | schema

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM