• Migrations


    Migrations是一个能够将数据库结构安全、标准地从一个版本移植到另一个版本开源项目。Migrations的目标是成为一个比Ruby on Rails Migration更企业化的工具。

    Introduction

    An application for standardizing and safely migrating database schemas from one version to another.

    Migrations is intended to be a more enterprise capable version of the Ruby on Rails Migration concept.

    Features

    Some of the features include ...

        * Multiple schema interactions with dependency resolution for both upgrade and downgrade
        * Runtime substitution of values such as tablespace names or data types
        * Version tracking of schema changes
        * Clean path for upgrading and downgrading the database
        * Multiline script support for doing things like pl/sql
        * Final raw sql script generation
        * Basic auditing of schema information including when it was modified, who modified it, and the ip it was modified from.
        * Production mode allowing for only upgrades to take place and not allowing accidental destruction of schema and data.
        * Clean migration indicators to allow understanding of which delta migrations failed and whether or not to prevent further migrations until human intervention has taken place in case of bad migration scripts.
        * Packaging (.zip or .jar) support for easy portability of db migration scripts.
        * Simple API usable for testing frameworks to do cleaner integration testing.
        * Easy to use unix and windows startup scripts

    Quick Overview

    Migrations works off of a simple pattern based system. The application will be told the location of a configuration file (often referred to as the migrations.xml). 1 or more folders which contain sql scripts should be present where the migration configuration is located at. Each folder represents a schema (things which could in theory reside in different database schemas even if they don't always in reality).

    Included with the downloaded applications are a basic-migration and advanced-migration folders which include example migrations.xml files as well.

    The basic migrations.xml looks like

    <migration>
      <schemas>
        <schema id="rolodex" driver="org.hsqldb.jdbcDriver"
          url="jdbc:hsqldb:mem:test" username="sa" password="" />
      </schemas>
    </migration>


    In this example migration, there is a rolodex defined. Thus there should be a folder located here as well named rolodex. Also note that for the schema element, the attributes driver, url, username, and password are optional and if not present will be prompted for during the migration process.

    Schema folders shall contain the up/down migration scripts which follow this pattern

    ###_(up|down)_description.sql

    Meaning that it must first start with a number 1 or higher which represents the migration version represented by that sql script. Then next section which is separated by an _ is the up/down section. Specifies whether these are upgrade or downgrade scripts respective. Both should exist in order to be able and downgrade or revert changes made. The final section is just a human sensible quick description of what the purpose of that migration script is. An example of what might exist in the myschema folder would be

    001_up_initialize.sql
    001_down_destroy.sql
    002_up_patch-person-table.sql
    002_down_rollback-person-table.sql
    003_up_create-uuid-column.sql
    003_down_delete-uuid-column.sql


    Once a migration configuration and sql scripts exist, anyone can simply point to the configuration location and migrate any schema to any version, use it for however long, and then migrate down to 0 to restore the database schema back to its original state.

    点击次数   官方主页【官方主页】   下载地址【下载地址】

    网友留言/评论

    我要留言/评论

    相关开源项目

    SmoothGallery:SmoothGallery是一个基于mootools构建具有幻灯片放映效果的JS相册组件。
    efhnbm:efhnbm(Explore from here NetBeans module)这个模块能够打开在NetBeans中选定节点所在的系统文件目录。当前自动支持所有Win32平台和Linux(GNOME/KDE)。

    Bounce:Bounce一组Java与Swing扩展类库包括:布局管理器如:FormLayout和CenterLayout,图片过滤器,一个XML编辑器工具箱支持语法高亮显示和自动缩排等功能。
    Rendezvous Groupware Suite:Rendezvous Groupware Suite是一个基于Web的协同办公套件。包括:Webmail、Calendar、Tasks、Contacts、项目管理、文档管理、RSS阅读器、mobile access、OTA(Over-The-Air)SyncML同步,集成Outlook、WebDAV access和一个Ajax胖客户端。
    JSwat:这是一个基于NetBeans平台的Java开源调试器。
    Daffodil replicator:daffodilreplicator是一个强大的,开源的数据同步工具。它可以在两个支持JDBC drivers的数据库之间进行双向数据同步操作。它有灵活的并同时支持快照与合并复制的发布和订阅Model。
    JML:JML是一个Java Msn Messenger开发包.支持MSNP8/9/10/11.
    jpos:jPOS是一个开源(文挡需要收费)的财务交易Java库和框架,能够通过定制和扩展,实现任何特殊的财务交换操作,适合要求高可用性的关键性业务处理过程。
    Jsp File Browser:一个简单但非常实用的JSP 程序,开发该程序的作者为它取名Jsp File Browser,用途是基于web方式远程访问和操作文件。Jsp File Browser功能很多,比如文件上传下载、执行本地 shell 命令、将文件目录压缩下载、查看压缩文件内容和解压缩等等。
    Swing AppFramework:这是一个Swing应用程序开发框架,提供一组用于简化桌面应用程序开发的Java类。包括:1.应用程序生命周期管理,特别是GUI的启动与关闭。2.资源管理和载入的支持,这些资源可以是字符串,格式化的消息,图像,颜色,字体以及桌面应用程序共有的其他类型资源。3.支持Action定义、管理和绑定,包括后台运行的异步Action。4.会话状态持久化:支持自动地或有选择地保存应用程序一次运行到下次运行的GUI状态。NetBeans6.0以上的版本都支持Swing Application Framework的开发。