- drop table TTL_AUDIT_REVISION if exists cascade;
- drop table TTL_EVENT if exists cascade;
+ alter table TTL_EVENT_AUD
+ drop constraint FK_cjsh8995uabmdm9b30uvmyj6p;
- drop table TTL_EVENT_AUD if exists cascade;
+ drop table TTL_AUDIT_REVISION if exists;
- drop sequence TTL_AUDIT_REVISION_SEQ if exists ;
+ drop table TTL_EVENT if exists;
- drop sequence TTL_EVENT_SEQ if exists ;
+ drop table TTL_EVENT_AUD if exists;
+ drop sequence TTL_AUDIT_REVISION_SEQ;
+
+ drop sequence TTL_EVENT_SEQ;
</properties>
- <profiles>
- <profile>
- <id>createHsqlDbScript</id>
- <!-- Activate this profile to create a database script for a clean HSQLDB schema -->
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
-
- <properties>
- <!-- These properties are filtered into the integration-test-context-properties
- and loaded by spring to run the integration tests -->
- <filter.execute.db.creation.script>true</filter.execute.db.creation.script>
- <filter.db.creation.script.location>classpath:/sql/create-tables-hsqldb.sql
- </filter.db.creation.script.location>
-
- <filter.dataSource.driverClassName>org.hsqldb.jdbc.JDBCDriver</filter.dataSource.driverClassName>
- <filter.dataSource.url>jdbc:hsqldb:mem:demodb</filter.dataSource.url>
- <filter.dataSource.user>sa</filter.dataSource.user>
- <filter.dataSource.password>sapwd</filter.dataSource.password>
- <filter.hibernate.dialect>org.hibernate.dialect.HSQLDialect</filter.hibernate.dialect>
-
- <!-- These properties are used by hibernate4-maven-plugin to create the script -->
- <hibernate.connection.driver_class>org.hsqldb.jdbcDriver</hibernate.connection.driver_class>
- <hibernate.dialect>org.hibernate.dialect.HSQLDialect</hibernate.dialect>
- <hibernate.connection.url>
- <![CDATA[jdbc:hsqldb:target/db/testdb;shutdown=true]]></hibernate.connection.url>
- <hibernate.connection.username>sa</hibernate.connection.username>
- <hibernate.connection.password></hibernate.connection.password>
- <hibernate.export.envers>true</hibernate.export.envers>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>de.juplo</groupId>
- <artifactId>hibernate4-maven-plugin</artifactId>
- <version>${de.juplo-hibernate-plugin-version}</version>
- <executions>
- <execution>
- <goals>
- <goal>export</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <outputFile>${project.build.sourceDirectory}/../scripts/sql/create-tables-hsqldb.sql
- </outputFile>
- <target>SCRIPT</target>
- <type>CREATE</type>
- </configuration>
- <dependencies>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>${org.hibernate.version}</version>
- </dependency>
- <dependency>
- <groupId>org.scannotation</groupId>
- <artifactId>scannotation</artifactId>
- <version>1.0.3</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>${org.slf4j.version}</version>
- </dependency>
- <dependency>
- <groupId>org.hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <version>${org.hsqldb.version}</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
<dependencies>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
+ <plugin>
+ <groupId>de.juplo</groupId>
+ <artifactId>hibernate4-maven-plugin</artifactId>
+ <version>${de.juplo-hibernate-plugin-version}</version>
+ <executions>
+ <execution>
+ <id>create-create-script</id>
+ <goals>
+ <goal>export</goal>
+ </goals>
+ <configuration>
+ <outputFile>${project.build.directory}/test-classes/sql/create-tables-hsqldb.sql
+ </outputFile>
+ <type>CREATE</type>
+ </configuration>
+ </execution>
+ <execution>
+ <id>create-drop-script</id>
+ <goals>
+ <goal>export</goal>
+ </goals>
+ <configuration>
+ <outputFile>${project.build.directory}/test-classes/sql/drop-tables-hsqldb.sql
+ </outputFile>
+ <type>DROP</type>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <target>SCRIPT</target>
+ <driverClassName>org.hsqldb.jdbc.JDBCDriver</driverClassName>
+ <hibernateDialect>org.hibernate.dialect.HSQLDialect</hibernateDialect>
+ <envers>true</envers>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>${org.hsqldb.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
<resources>
+++ /dev/null
-
- create table TTL_AUDIT_REVISION (
- ID bigint not null,
- EVENT_DATE timestamp,
- ENVERS_TSTAMP bigint not null,
- USER_NAME varchar(80) not null,
- primary key (ID)
- );
-
- create table TTL_EVENT (
- ID bigint not null,
- EVENT_DATE timestamp not null,
- TITLE varchar(80) not null,
- primary key (ID)
- );
-
- create table TTL_EVENT_AUD (
- ID bigint not null,
- REV bigint not null,
- REVTYPE tinyint,
- EVENT_DATE timestamp,
- TITLE varchar(80),
- primary key (ID, REV)
- );
-
- alter table TTL_EVENT_AUD
- add constraint FK_cjsh8995uabmdm9b30uvmyj6p
- foreign key (REV)
- references TTL_AUDIT_REVISION;
-
- create sequence TTL_AUDIT_REVISION_SEQ;
-
- create sequence TTL_EVENT_SEQ;