日期:2014-05-16 浏览次数:21401 次
<?xml version="1.0" encoding="UTF-8"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd"> <changeSet id="1" author="jim"> <createTable tableName="useraccount"> <column name="userid" type="bigint(20)"> <constraints primaryKey="true" /> </column> <column name="accountstate" type="varchar(255)" /> <column name="expiredDate" type="datetime" /> <column name="username" type="varchar(255)" /> </createTable> <addUniqueConstraint tableName="useraccount" columnNames="username" constraintName="username" /> </changeSet> <changeSet id="2" author="jim"> <addColumn tableName="useraccount"> <column name="gender" type="varchar(1)" value="M"> <constraints nullable="false"/> </column> </addColumn> </changeSet> </databaseChangeLog>
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <display-name>liquid</display-name> <description>MySQL Test App</description> <resource-ref> <description>DB Connection</description> <res-ref-name>jdbc/test</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> <context-param> <param-name>LIQUIBASE_CHANGELOG</param-name> <param-value>db.changelog.xml</param-value> </context-param> <context-param> <param-name>LIQUIBASE_DATA_SOURCE</param-name> <param-value>java:comp/env/jdbc/test</param-value> </context-param> <context-param> <param-name>LIQUIBASE_FAIL_ON_ERROR</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>LIQUIBASE_CONTEXTS</param-name> <param-value>jdbc/test</param-value> </context-param> <listener> <listener-class>liquibase.servlet.LiquibaseServletListener</listener-class> </listener> </web-app>