Skip to content
Snippets Groups Projects
Commit 326d891e authored by Arnaud Jelmoni's avatar Arnaud Jelmoni
Browse files
parent ec6354a5
No related branches found
No related tags found
No related merge requests found
Showing
with 933 additions and 136 deletions
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" <project
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
...@@ -124,14 +126,52 @@ ...@@ -124,14 +126,52 @@
<groupId>com.googlecode.log4jdbc</groupId> <groupId>com.googlecode.log4jdbc</groupId>
<artifactId>log4jdbc</artifactId> <artifactId>log4jdbc</artifactId>
</dependency> </dependency>
<dependency> <!-- Test -->
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>3.4.2</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.200</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>oracle-xe</artifactId>
<version>1.15.1</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.5.3</version>
<configuration>
<changeLogFile>src/main/resources/liquibase/master.xml</changeLogFile>
<diffChangeLogFile>src/main/resources/liquibase/changelog/20190411-103909_changelog.xml</diffChangeLogFile>
<driver>org.h2.Driver</driver>
<url>jdbc:h2:mem:SNAP;DB_CLOSE_DELAY=-1;INIT=CREATE SCHEMA IF NOT EXISTS SNAP\;SET SCHEMA SNAP;</url>
<defaultSchemaName>SNAP</defaultSchemaName>
<contexts>test</contexts>
<username>snap</username>
<password>snap</password>
<outputChangeLogFile>myGenChangeLog.xml</outputChangeLogFile>
<logging>debug</logging>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project> </project>
package fr.soleil.archiving.snap.api.model;
// Generated 8 janv. 2021 � 16:24:38 by Hibernate Tools 4.3.5.Final
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* Ast generated by hbm2java
*/
@Entity
@Table(name = "AST")
public class Ast implements java.io.Serializable {
private int id;
private Date time;
private String fullName;
private String device;
private String domain;
private String family;
private String member;
private String attName;
private BigDecimal dataType;
private BigDecimal dataFormat;
private BigDecimal writable;
private BigDecimal maxDimX;
private BigDecimal maxDimY;
private BigDecimal levelg;
private String facility;
private BigDecimal archivable;
private BigDecimal substitute;
public Ast() {
}
public Ast(int id, String fullName, String device, String domain, String family, String member, String attName,
BigDecimal dataType, BigDecimal dataFormat, BigDecimal writable, String facility) {
this.id = id;
this.fullName = fullName;
this.device = device;
this.domain = domain;
this.family = family;
this.member = member;
this.attName = attName;
this.dataType = dataType;
this.dataFormat = dataFormat;
this.writable = writable;
this.facility = facility;
}
public Ast(int id, Date time, String fullName, String device, String domain, String family, String member,
String attName, BigDecimal dataType, BigDecimal dataFormat, BigDecimal writable, BigDecimal maxDimX,
BigDecimal maxDimY, BigDecimal levelg, String facility, BigDecimal archivable, BigDecimal substitute) {
this.id = id;
this.time = time;
this.fullName = fullName;
this.device = device;
this.domain = domain;
this.family = family;
this.member = member;
this.attName = attName;
this.dataType = dataType;
this.dataFormat = dataFormat;
this.writable = writable;
this.maxDimX = maxDimX;
this.maxDimY = maxDimY;
this.levelg = levelg;
this.facility = facility;
this.archivable = archivable;
this.substitute = substitute;
}
@Id
@Column(name = "ID", nullable = false, precision = 5, scale = 0)
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
@Temporal(TemporalType.DATE)
@Column(name = "TIME", length = 7)
public Date getTime() {
return this.time;
}
public void setTime(Date time) {
this.time = time;
}
@Column(name = "FULL_NAME", nullable = false, length = 500)
public String getFullName() {
return this.fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
@Column(name = "DEVICE", nullable = false, length = 500)
public String getDevice() {
return this.device;
}
public void setDevice(String device) {
this.device = device;
}
@Column(name = "DOMAIN", nullable = false, length = 500)
public String getDomain() {
return this.domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
@Column(name = "FAMILY", nullable = false, length = 500)
public String getFamily() {
return this.family;
}
public void setFamily(String family) {
this.family = family;
}
@Column(name = "MEMBER", nullable = false, length = 500)
public String getMember() {
return this.member;
}
public void setMember(String member) {
this.member = member;
}
@Column(name = "ATT_NAME", nullable = false, length = 500)
public String getAttName() {
return this.attName;
}
public void setAttName(String attName) {
this.attName = attName;
}
@Column(name = "DATA_TYPE", nullable = false, precision = 22, scale = 0)
public BigDecimal getDataType() {
return this.dataType;
}
public void setDataType(BigDecimal dataType) {
this.dataType = dataType;
}
@Column(name = "DATA_FORMAT", nullable = false, precision = 22, scale = 0)
public BigDecimal getDataFormat() {
return this.dataFormat;
}
public void setDataFormat(BigDecimal dataFormat) {
this.dataFormat = dataFormat;
}
@Column(name = "WRITABLE", nullable = false, precision = 22, scale = 0)
public BigDecimal getWritable() {
return this.writable;
}
public void setWritable(BigDecimal writable) {
this.writable = writable;
}
@Column(name = "MAX_DIM_X", precision = 22, scale = 0)
public BigDecimal getMaxDimX() {
return this.maxDimX;
}
public void setMaxDimX(BigDecimal maxDimX) {
this.maxDimX = maxDimX;
}
@Column(name = "MAX_DIM_Y", precision = 22, scale = 0)
public BigDecimal getMaxDimY() {
return this.maxDimY;
}
public void setMaxDimY(BigDecimal maxDimY) {
this.maxDimY = maxDimY;
}
@Column(name = "LEVELG", precision = 22, scale = 0)
public BigDecimal getLevelg() {
return this.levelg;
}
public void setLevelg(BigDecimal levelg) {
this.levelg = levelg;
}
@Column(name = "FACILITY", nullable = false, length = 100)
public String getFacility() {
return this.facility;
}
public void setFacility(String facility) {
this.facility = facility;
}
@Column(name = "ARCHIVABLE", precision = 22, scale = 0)
public BigDecimal getArchivable() {
return this.archivable;
}
public void setArchivable(BigDecimal archivable) {
this.archivable = archivable;
}
@Column(name = "SUBSTITUTE", precision = 22, scale = 0)
public BigDecimal getSubstitute() {
return this.substitute;
}
public void setSubstitute(BigDecimal substitute) {
this.substitute = substitute;
}
}
package fr.soleil.archiving.snap.api.model;
// Generated 8 janv. 2021 � 16:24:38 by Hibernate Tools 4.3.5.Final
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* Context generated by hbm2java
*/
@Entity
@Table(name = "CONTEXT")
public class Context implements java.io.Serializable {
private int idContext;
private Date time;
private String name;
private String author;
private String reason;
private String description;
public Context() {
}
public Context(int idContext) {
this.idContext = idContext;
}
public Context(int idContext, Date time, String name, String author, String reason, String description) {
this.idContext = idContext;
this.time = time;
this.name = name;
this.author = author;
this.reason = reason;
this.description = description;
}
@Id
@Column(name = "ID_CONTEXT", nullable = false, precision = 5, scale = 0)
public int getIdContext() {
return this.idContext;
}
public void setIdContext(int idContext) {
this.idContext = idContext;
}
@Temporal(TemporalType.DATE)
@Column(name = "TIME", length = 7)
public Date getTime() {
return this.time;
}
public void setTime(Date time) {
this.time = time;
}
@Column(name = "NAME", length = 256)
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
@Column(name = "AUTHOR", length = 64)
public String getAuthor() {
return this.author;
}
public void setAuthor(String author) {
this.author = author;
}
@Column(name = "REASON", length = 640)
public String getReason() {
return this.reason;
}
public void setReason(String reason) {
this.reason = reason;
}
@Column(name = "DESCRIPTION", length = 1256)
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
}
...@@ -8,7 +8,7 @@ import javax.persistence.Id; ...@@ -8,7 +8,7 @@ import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
@Entity @Entity
@Table(name = "SNAPSHOT", schema = "SNAP") @Table(name = "SNAPSHOT")
public class Snapshot implements Serializable { public class Snapshot implements Serializable {
/** /**
* *
......
...@@ -5,6 +5,7 @@ import static org.junit.Assert.assertNotNull; ...@@ -5,6 +5,7 @@ import static org.junit.Assert.assertNotNull;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.test.annotation.Rollback; import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -13,10 +14,12 @@ import fr.soleil.archiving.snap.api.persistence.spring.dao.ValDAO; ...@@ -13,10 +14,12 @@ import fr.soleil.archiving.snap.api.persistence.spring.dao.ValDAO;
import fr.soleil.archiving.snap.api.persistence.spring.dto.Val; import fr.soleil.archiving.snap.api.persistence.spring.dto.Val;
@Rollback(true) @Rollback(true)
@ActiveProfiles({ "test" })
@ContextConfiguration({ "classpath:beans.xml" }) @ContextConfiguration({ "classpath:beans.xml" })
@Transactional @Transactional
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
public abstract class AbstractValDAOTest<V extends Val> { public abstract class AbstractValDAOTest<V extends Val> {
protected void compare(V original, V copy) { protected void compare(V original, V copy) {
assertNotNull(copy); assertNotNull(copy);
} }
......
...@@ -2,6 +2,7 @@ package fr.soleil.archiving.snap.api.persistence.spring.dao.test; ...@@ -2,6 +2,7 @@ package fr.soleil.archiving.snap.api.persistence.spring.dao.test;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
...@@ -49,4 +50,15 @@ public class ScNum1ValDAOTest extends AbstractValDAOTest<ScNum1Val> { ...@@ -49,4 +50,15 @@ public class ScNum1ValDAOTest extends AbstractValDAOTest<ScNum1Val> {
protected ValDAO<ScNum1Val> getDao() { protected ValDAO<ScNum1Val> getDao() {
return dao; return dao;
} }
@Test
public void testFetchFromBdd() {
CompositeId compositeId = new CompositeId();
int idAtt = 245;
int idSnap = 235;
compositeId.setIdAtt(idAtt);
compositeId.setIdSnap(idSnap);
ScNum1Val val = getDao().findByKey(compositeId);
assertEquals(val.getValue(), 23.0, 0);
}
} }
...@@ -8,6 +8,7 @@ import org.junit.Test; ...@@ -8,6 +8,7 @@ import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback; import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -16,6 +17,7 @@ import fr.soleil.archiving.snap.api.model.Snapshot; ...@@ -16,6 +17,7 @@ import fr.soleil.archiving.snap.api.model.Snapshot;
import fr.soleil.archiving.snap.api.persistence.spring.dao.SnapshotDAO; import fr.soleil.archiving.snap.api.persistence.spring.dao.SnapshotDAO;
@Rollback(true) @Rollback(true)
@ActiveProfiles({ "test" })
@ContextConfiguration({ "classpath:beans.xml" }) @ContextConfiguration({ "classpath:beans.xml" })
@Transactional @Transactional
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
......
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="fr.soleil.archiving.snap.api"/>
<!-- DATASOURCE DEFINITION VVVVVVV-->
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="initialSize" value="8"/>
<property name="maxActive" value="4"/>
<property name="maxIdle" value="8"/>
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@195.221.4.203:1521:TEST11SE" />
<property name="username" value="snap" />
<property name="password" value="snap" />
</bean>
<!-- DATASOURCE DEFINITION ^^^^^^-->
<!-- HIBERNATE DEFINITION VVVVVVV-->
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="mappingResources">
<list>
<value>valueTables.hbm.xml</value>
</list>
</property>
<property name="packagesToScan" value="fr.soleil.archiving.snap.api.model" />
<property name="hibernateProperties">
<value>
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
hibernate.default_schema=SNAP
hibernate.show_sql=true
hibernate.format_sql=true
hibernate.transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory
hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
hibernate.connection.autocommit=false
hibernate.connection.release_mode=after_transaction
hibernate.generate_statistics=true
</value>
</property>
</bean>
<!-- HIBERNATE DEFINITION ^^^^^^-->
<!-- TRANSACTIONS DEFINITIONS VVVVVVV-->
<!-- MANAGER -->
<bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
<!-- DEFINES AN "ADVICE" IE. A WAY TO USE THE TRANSACTION MANAGER AROUND METHODS -->
<tx:advice id="txAdvice" transaction-manager="transactionManager"><!-- the transactional advice (i.e. what 'happens'; see the <aop:advisor/> bean below) -->
<tx:attributes><!-- the transactional semantics... -->
<tx:method name="findBy*" read-only="true"/><!-- all methods starting with 'get' are read-only -->
<tx:method name="*"/><!-- other methods use the default transaction settings -->
</tx:attributes>
</tx:advice>
<!-- DEFINES WHERE "ADVICES" WILL BE USED-->
<aop:config><!-- ensure that the above transactional advice runs for any execution of an operation defined by the FooService interface -->
<aop:pointcut id="valDAOOperation" expression="execution(* fr.soleil.archiving.snap.api.persistence.spring.dao.ValDAO.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="valDAOOperation"/>
</aop:config>
<!-- TRANSACTIONS DEFINITIONS ^^^^^^-->
</beans>
\ No newline at end of file
...@@ -16,12 +16,21 @@ ...@@ -16,12 +16,21 @@
<property name="maxActive" value="4"/> <property name="maxActive" value="4"/>
<property name="maxIdle" value="8"/> <property name="maxIdle" value="8"/>
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" /> <property name="driverClassName" value="org.h2.Driver" />
<property name="url" value="jdbc:oracle:thin:@195.221.4.203:1521:TEST11SE" /> <property name="url" value="jdbc:h2:mem:SNAP;DB_CLOSE_DELAY=-1;INIT=CREATE
SCHEMA IF NOT EXISTS SNAP\;SET SCHEMA SNAP;" />
<property name="username" value="snap" /> <property name="username" value="snap" />
<property name="password" value="snap" /> <property name="password" value="snap" />
</bean> </bean>
<!-- DATASOURCE DEFINITION ^^^^^^--> <!-- DATASOURCE DEFINITION ^^^^^^-->
<bean id="liquibase" class="liquibase.integration.spring.SpringLiquibase">
<property name="dataSource" ref="dataSource" />
<property name="changeLog" value="classpath:liquibase/master.xml" />
<!--
contexts specifies the runtime contexts to use.
-->
<property name="contexts" value="test" />
</bean>
<!-- HIBERNATE DEFINITION VVVVVVV--> <!-- HIBERNATE DEFINITION VVVVVVV-->
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"> <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
...@@ -36,8 +45,8 @@ ...@@ -36,8 +45,8 @@
<property name="hibernateProperties"> <property name="hibernateProperties">
<value> <value>
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect hibernate.dialect=org.hibernate.dialect.H2Dialect
hibernate.default_schema=SNAP hibernate.default_schema=PUBLIC
hibernate.show_sql=true hibernate.show_sql=true
hibernate.format_sql=true hibernate.format_sql=true
hibernate.transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory hibernate.transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory
......
ID,TIME,FULL_NAME,DEVICE,DOMAIN,FAMILY,MEMBER,ATT_NAME,DATA_TYPE,DATA_FORMAT,WRITABLE,MAX_DIM_X,MAX_DIM_Y,LEVELG,FACILITY,ARCHIVABLE,SUBSTITUTE
245,2020-03-11,tango/tangotest/1/short_scalar_ro,tango/tangotest/1,tango,tangotest,1,short_scalar_ro,2,0,0,1,0,0,HOST:port,0,0
ID_CONTEXT,TIME,NAME,AUTHOR,REASON,DESCRIPTION
76,2020-03-11,test scalars,girardot,test scalar attributes,contains tangotest scalar attributes
77,2020-04-08,test all scalars,girardot,test all kinds of scalar attributes,contains tangotest scalar attributes
78,2020-04-14,Test add/remove attributes,girardot,TANGOARCH-629,"Add all tangotest1 attributes, remove some of them, register and see what's left"
80,2020-08-06,test scalars2,girardot,test scalar attributes,contains tangotest scalar attributes
79,2020-04-20,test2,spjz,essai2,essai bug2
75,2020-02-05,test4,piketty,test too,test
ID_SNAP,ID_CONTEXT,TIME,SNAP_COMMENT
209,76,2020-03-11 10:17:11,
214,76,2020-04-06 12:15:12,
217,76,2020-04-06 13:46:25.239,
219,76,2020-04-08 14:53:12.589,
220,76,2020-04-08 15:06:59.309,
221,76,2020-04-08 15:14:02.01,
224,76,2020-04-08 15:23:26.247,
226,76,2020-04-08 15:32:04.588,
233,76,2020-04-08 16:03:09.622,
236,77,2020-04-08 17:20:12.293,
216,76,2020-04-06 12:20:12.325,
231,76,2020-04-08 15:53:45.697,
207,75,2020-03-11 09:17:17.474,
210,76,2020-04-06 10:43:37.439,
230,76,2020-04-08 15:45:50.28,
234,76,2020-04-08 16:24:42.768,
208,76,2020-03-11 09:56:09.147,
211,76,2020-04-06 10:57:27.392,
215,76,2020-04-06 12:19:55.687,
223,76,2020-04-08 15:17:07.947,
225,76,2020-04-08 15:30:20.314,
228,76,2020-04-08 15:39:16.911,
229,76,2020-04-08 15:39:18.216,
232,76,2020-04-08 15:58:51.635,
237,75,2020-04-20 12:08:23.727,
212,76,2020-04-06 11:54:49.818,
213,76,2020-04-06 11:58:59.342,
218,76,2020-04-07 16:22:33.81,
222,76,2020-04-08 15:15:28.57,
227,76,2020-04-08 15:33:28.613,
235,76,2020-04-08 17:15:38.751,
ID_SNAP,ID_ATT,VALUE
235,245,23.0
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
<changeSet author="jhaderer" id="000-testdata-1" context="test">
<loadUpdateData
tableName="context"
primaryKey="ID_CONTEXT"
encoding="UTF-8"
relativeToChangelogFile="true"
file="context.csv">
</loadUpdateData>
</changeSet>
<changeSet author="jhaderer" id="000-testdata-2" context="test">
<loadUpdateData
tableName="snapshot"
primaryKey="ID_SNAP"
encoding="UTF-8"
relativeToChangelogFile="true"
file="snapshot.csv">
</loadUpdateData>
</changeSet>
<changeSet author="jhaderer" id="000-testdata-3" context="test">
<loadUpdateData
tableName="AST"
primaryKey="ID"
encoding="UTF-8"
relativeToChangelogFile="true"
file="ast.csv">
</loadUpdateData>
</changeSet>
<changeSet author="jhaderer" id="000-testdata-4" context="test">
<loadUpdateData
tableName="T_SC_NUM_1VAL"
primaryKey="ID_SNAP,ID_ATT"
encoding="UTF-8"
relativeToChangelogFile="true"
file="tScNum1Val.csv">
</loadUpdateData>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
<changeSet author="jelmoni (generated)" id="1610354256692-4">
<createTable tableName="AST">
<column name="ID" type="NUMBER(5, 0)">
<constraints nullable="false"/>
</column>
<column name="TIME" type="date"/>
<column name="FULL_NAME" type="VARCHAR2(500 BYTE)">
<constraints nullable="false"/>
</column>
<column name="DEVICE" type="VARCHAR2(500 BYTE)">
<constraints nullable="false"/>
</column>
<column name="DOMAIN" type="VARCHAR2(500 BYTE)">
<constraints nullable="false"/>
</column>
<column name="FAMILY" type="VARCHAR2(500 BYTE)">
<constraints nullable="false"/>
</column>
<column name="MEMBER" type="VARCHAR2(500 BYTE)">
<constraints nullable="false"/>
</column>
<column name="ATT_NAME" type="VARCHAR2(500 BYTE)">
<constraints nullable="false"/>
</column>
<column name="DATA_TYPE" type="NUMBER">
<constraints nullable="false"/>
</column>
<column name="DATA_FORMAT" type="NUMBER">
<constraints nullable="false"/>
</column>
<column name="WRITABLE" type="NUMBER">
<constraints nullable="false"/>
</column>
<column name="MAX_DIM_X" type="NUMBER"/>
<column name="MAX_DIM_Y" type="NUMBER"/>
<column name="LEVELG" type="NUMBER"/>
<column name="FACILITY" type="VARCHAR2(100 BYTE)">
<constraints nullable="false"/>
</column>
<column name="ARCHIVABLE" type="NUMBER"/>
<column name="SUBSTITUTE" type="NUMBER"/>
</createTable>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-5">
<createTable tableName="CONTEXT">
<column name="ID_CONTEXT" type="NUMBER(5, 0)">
<constraints nullable="false"/>
</column>
<column name="TIME" type="date"/>
<column name="NAME" type="VARCHAR2(256 BYTE)"/>
<column name="AUTHOR" type="VARCHAR2(64 BYTE)"/>
<column name="REASON" type="VARCHAR2(640 BYTE)"/>
<column name="DESCRIPTION" type="VARCHAR2(1256 BYTE)"/>
</createTable>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-6">
<createTable tableName="LIST">
<column name="ID_CONTEXT" type="NUMBER(5, 0)"/>
<column name="ID_ATT" type="NUMBER(5, 0)"/>
</createTable>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-7">
<createTable tableName="SNAPSHOT">
<column name="ID_SNAP" type="NUMBER(5, 0)">
<constraints nullable="false"/>
</column>
<column name="ID_CONTEXT" type="NUMBER(5, 0)"/>
<column name="TIME" type="TIMESTAMP(3)"/>
<column name="SNAP_COMMENT" type="VARCHAR2(2500 BYTE)"/>
</createTable>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-8">
<createTable tableName="T_SC_NUM_1VAL">
<column name="ID_SNAP" type="NUMBER"/>
<column name="ID_ATT" type="NUMBER"/>
<column name="VALUE" type="NUMBER"/>
</createTable>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-9">
<createTable tableName="T_SC_NUM_2VAL">
<column name="ID_SNAP" type="NUMBER"/>
<column name="ID_ATT" type="NUMBER"/>
<column name="READ_VALUE" type="NUMBER"/>
<column name="WRITE_VALUE" type="NUMBER"/>
</createTable>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-10">
<createTable tableName="T_SC_STR_1VAL">
<column name="ID_SNAP" type="NUMBER"/>
<column name="ID_ATT" type="NUMBER"/>
<column name="VALUE" type="VARCHAR2(2500 BYTE)"/>
</createTable>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-11">
<createTable tableName="T_SC_STR_2VAL">
<column name="ID_SNAP" type="NUMBER"/>
<column name="ID_ATT" type="NUMBER"/>
<column name="READ_VALUE" type="VARCHAR2(2500 BYTE)"/>
<column name="WRITE_VALUE" type="VARCHAR2(2500 BYTE)"/>
</createTable>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-12">
<createTable tableName="T_SP_1VAL">
<column name="ID_SNAP" type="NUMBER"/>
<column name="ID_ATT" type="NUMBER"/>
<column name="DIM_X" type="NUMBER"/>
<column name="VALUE" type="CLOB"/>
</createTable>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-13">
<createTable tableName="T_SP_2VAL">
<column name="ID_SNAP" type="NUMBER"/>
<column name="ID_ATT" type="NUMBER"/>
<column name="DIM_X" type="NUMBER"/>
<column name="READ_VALUE" type="CLOB"/>
<column name="WRITE_VALUE" type="CLOB"/>
</createTable>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-14">
<createIndex indexName="IND_IDAST" tableName="AST">
<column name="ID"/>
</createIndex>
<addPrimaryKey columnNames="ID" constraintName="PK_AST" tableName="AST"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-15">
<createIndex indexName="IND_IDCONTEXT" tableName="CONTEXT">
<column name="ID_CONTEXT"/>
</createIndex>
<addPrimaryKey columnNames="ID_CONTEXT" constraintName="PK_CONTEXT" tableName="CONTEXT"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-16">
<createIndex indexName="IND_IDSNAPSHOT" tableName="SNAPSHOT">
<column name="ID_SNAP"/>
</createIndex>
<addPrimaryKey columnNames="ID_SNAP" constraintName="PK_SNAPSHOT" tableName="SNAPSHOT"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-17">
<createIndex indexName="IND_IDLIST" tableName="LIST">
<column name="ID_CONTEXT"/>
</createIndex>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-18">
<createIndex indexName="IND_SC_NUM_1VAL" tableName="T_SC_NUM_1VAL">
<column name="ID_SNAP"/>
<column name="ID_ATT"/>
</createIndex>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-19">
<createIndex indexName="IND_SC_NUM_2VAL" tableName="T_SC_NUM_2VAL">
<column name="ID_SNAP"/>
<column name="ID_ATT"/>
</createIndex>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-20">
<createIndex indexName="IND_SC_STR_1VAL" tableName="T_SC_STR_1VAL">
<column name="ID_SNAP"/>
<column name="ID_ATT"/>
</createIndex>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-21">
<createIndex indexName="IND_SC_STR_2VAL" tableName="T_SC_STR_2VAL">
<column name="ID_SNAP"/>
<column name="ID_ATT"/>
</createIndex>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-22">
<createIndex indexName="IND_SP_1VAL" tableName="T_SP_1VAL">
<column name="ID_SNAP"/>
<column name="ID_ATT"/>
</createIndex>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-23">
<createIndex indexName="IND_SP_2VAL" tableName="T_SP_2VAL">
<column name="ID_SNAP"/>
<column name="ID_ATT"/>
</createIndex>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-24">
<addForeignKeyConstraint baseColumnNames="ID_ATT" baseTableName="T_SC_NUM_1VAL" constraintName="FKSNAP_SC_NUM_1VAL_ATTID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID" referencedTableName="AST"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-25">
<addForeignKeyConstraint baseColumnNames="ID_SNAP" baseTableName="T_SC_NUM_1VAL" constraintName="FKSNAP_SC_NUM_1VAL_SNAPID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID_SNAP" referencedTableName="SNAPSHOT"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-26">
<addForeignKeyConstraint baseColumnNames="ID_ATT" baseTableName="T_SC_NUM_2VAL" constraintName="FKSNAP_SC_NUM_2VAL_ATTID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID" referencedTableName="AST"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-27">
<addForeignKeyConstraint baseColumnNames="ID_SNAP" baseTableName="T_SC_NUM_2VAL" constraintName="FKSNAP_SC_NUM_2VAL_SNAPID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID_SNAP" referencedTableName="SNAPSHOT"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-28">
<addForeignKeyConstraint baseColumnNames="ID_ATT" baseTableName="T_SC_STR_1VAL" constraintName="FKSNAP_SC_STR_1VAL_ATTID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID" referencedTableName="AST"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-29">
<addForeignKeyConstraint baseColumnNames="ID_SNAP" baseTableName="T_SC_STR_1VAL" constraintName="FKSNAP_SC_STR_1VAL_SNAPID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID_SNAP" referencedTableName="SNAPSHOT"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-30">
<addForeignKeyConstraint baseColumnNames="ID_ATT" baseTableName="T_SC_STR_2VAL" constraintName="FKSNAP_SC_STR_2VAL_ATTID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID" referencedTableName="AST"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-31">
<addForeignKeyConstraint baseColumnNames="ID_SNAP" baseTableName="T_SC_STR_2VAL" constraintName="FKSNAP_SC_STR_2VAL_SNAPID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID_SNAP" referencedTableName="SNAPSHOT"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-32">
<addForeignKeyConstraint baseColumnNames="ID_ATT" baseTableName="T_SP_1VAL" constraintName="FKSNAP_SP_1VAL_ATTID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID" referencedTableName="AST"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-33">
<addForeignKeyConstraint baseColumnNames="ID_SNAP" baseTableName="T_SP_1VAL" constraintName="FKSNAP_SP_1VAL_SNAPID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID_SNAP" referencedTableName="SNAPSHOT"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-34">
<addForeignKeyConstraint baseColumnNames="ID_ATT" baseTableName="T_SP_2VAL" constraintName="FKSNAP_SP_2VAL_ATTID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID" referencedTableName="AST"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-35">
<addForeignKeyConstraint baseColumnNames="ID_SNAP" baseTableName="T_SP_2VAL" constraintName="FKSNAP_SP_2VAL_SNAPID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID_SNAP" referencedTableName="SNAPSHOT"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-36">
<addForeignKeyConstraint baseColumnNames="ID_ATT" baseTableName="LIST" constraintName="FK_IDATTFROMLIST" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID" referencedTableName="AST"/>
</changeSet>
<changeSet author="jelmoni (generated)" id="1610354256692-37">
<addForeignKeyConstraint baseColumnNames="ID_CONTEXT" baseTableName="LIST" constraintName="FK_IDCONTEXTFROMLIST" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ID_CONTEXT" referencedTableName="CONTEXT"/>
</changeSet>
</databaseChangeLog>
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
<include file="initDB.xml" relativeToChangelogFile="true"/>
<include file="data/test-data.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment