cust-service db-migration

This commit is contained in:
Peter Hormanns 2017-02-07 19:59:10 +01:00
parent 0749aba53d
commit 9039f2025d
67 changed files with 1103 additions and 28 deletions

26
cust-services/.classpath Normal file
View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

1
cust-services/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target/

23
cust-services/.project Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>cust-webapp</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

70
cust-services/pom.xml Normal file
View File

@ -0,0 +1,70 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.hsadmin</groupId>
<artifactId>hsadmin-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>cust-webapp</artifactId>
<packaging>war</packaging>
<name>HSAdmin XML-RPC Customers Webapp</name>
<dependencies>
<dependency>
<groupId>de.hsadmin</groupId>
<artifactId>framework</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jpa_2.0_spec</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-ejb_3.0_spec</artifactId>
<version>1.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-validation_1.0_spec</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.xmlrpc</groupId>
<artifactId>xmlrpc-server</artifactId>
<version>3.1.3</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<finalName>xmlrpc-webapp</finalName>
<plugins>
<plugin>
<groupId>org.apache.openejb.maven</groupId>
<artifactId>tomee-maven-plugin</artifactId>
<version>1.7.4</version>
<configuration>
<tomeeVersion>1.7.4</tomeeVersion>
<tomeeClassifier>webprofile</tomeeClassifier>
<debug>false</debug>
<debugPort>8000</debugPort>
<config>${project.basedir}/src/test/tomee/conf</config>
<libs>
<lib>org.postgresql:postgresql:9.4.1212.jre7</lib>
</libs>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -2,19 +2,19 @@ package de.hsadmin.bo.pac;
import java.util.Date; import java.util.Date;
import javax.jms.JMSException; //import javax.jms.JMSException;
import javax.jms.Queue; //import javax.jms.Queue;
import javax.jms.QueueConnection; //import javax.jms.QueueConnection;
import javax.jms.QueueSender; //import javax.jms.QueueSender;
import javax.jms.QueueSession; //import javax.jms.QueueSession;
import javax.jms.Session; //import javax.jms.Session;
import javax.jms.TextMessage; //import javax.jms.TextMessage;
import javax.persistence.PostLoad; import javax.persistence.PostLoad;
import javax.persistence.PostPersist; import javax.persistence.PostPersist;
import javax.persistence.PostUpdate; import javax.persistence.PostUpdate;
import javax.persistence.PreRemove; import javax.persistence.PreRemove;
import org.apache.activemq.ActiveMQConnectionFactory; //import org.apache.activemq.ActiveMQConnectionFactory;
public class PacEntityListener { public class PacEntityListener {
@ -101,26 +101,26 @@ public class PacEntityListener {
public void sendNotification(final String module, final String opCode, final String name) public void sendNotification(final String module, final String opCode, final String name)
{ {
final ActiveMQConnectionFactory connFactory = new ActiveMQConnectionFactory("ssl://hsh03.hostsharing.net:61617"); // final ActiveMQConnectionFactory connFactory = new ActiveMQConnectionFactory("ssl://hsh03.hostsharing.net:61617");
QueueConnection connection = null; // QueueConnection connection = null;
try { // try {
connection = connFactory.createQueueConnection("user-pactasks", "Ohf4oh"); // connection = connFactory.createQueueConnection("user-pactasks", "Ohf4oh");
connection.start(); // connection.start();
final QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); // final QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
final Queue queue = session.createQueue("queue.hsadminSystem-pactasks"); // final Queue queue = session.createQueue("queue.hsadminSystem-pactasks");
final String string = module + "." + opCode + ":" + name + ":" + new Date(); // final String string = module + "." + opCode + ":" + name + ":" + new Date();
System.out.println(string); // System.out.println(string);
final TextMessage message = session.createTextMessage(string); // final TextMessage message = session.createTextMessage(string);
final QueueSender sender = session.createSender(queue); // final QueueSender sender = session.createSender(queue);
sender.send(message); // sender.send(message);
sender.close(); // sender.close();
session.close(); // session.close();
} catch (JMSException e) { // } catch (JMSException e) {
// TODO Auto-generated catch block // // TODO Auto-generated catch block
e.printStackTrace(); // e.printStackTrace();
} finally { // } finally {
if (connection != null) { try { connection.close(); } catch(JMSException e) { } } // if (connection != null) { try { connection.close(); } catch(JMSException e) { } }
} // }
} }
public static void main(String[] args) { public static void main(String[] args) {

View File

@ -0,0 +1,34 @@
package de.hsadmin.test.pac;
import static org.junit.Assert.fail;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
public class PacIT {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public void test() {
fail("Not yet implemented");
}
}

36
db-migration/.classpath Normal file
View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

1
db-migration/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target/

23
db-migration/.project Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>db-migration</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,5 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

45
db-migration/pom.xml Normal file
View File

@ -0,0 +1,45 @@
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.hsadmin</groupId>
<artifactId>hsadmin-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>db-migration</artifactId>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>3.5.3</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<finalName>db-migration</finalName>
<plugins>
<plugin>
<groupId>org.apache.openejb.maven</groupId>
<artifactId>tomee-maven-plugin</artifactId>
<version>1.7.4</version>
<configuration>
<tomeeVersion>1.7.4</tomeeVersion>
<tomeeClassifier>webprofile</tomeeClassifier>
<debug>false</debug>
<debugPort>8000</debugPort>
<config>${project.basedir}/src/test/tomee/conf</config>
<libs>
<lib>org.postgresql:postgresql:9.4.1212.jre7</lib>
</libs>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,22 @@
package de.hsadmin.migration;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns={"/", "/*"})
public class Watch extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException
{
resp.setContentType("text/plain");
resp.getWriter().println("servlet loaded");
}
}

View File

@ -0,0 +1,727 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
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.5.xsd http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<changeSet author="HSDB" id="generated-1">
<createSequence sequenceName="bank_account_bank_account_i_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-2">
<createSequence sequenceName="bank_account_bank_account_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-3">
<createSequence sequenceName="basecomponent_basecomponent_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-4">
<createSequence sequenceName="basepacket_basepacket_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-5">
<createSequence sequenceName="billdata_billdata_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-6">
<createSequence sequenceName="business_partner_bp_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-7">
<createSequence sequenceName="component_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-8">
<createSequence sequenceName="contact_contact_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-9">
<createSequence sequenceName="database_database_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-10">
<createSequence sequenceName="dbuser_dbuser_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-11">
<createSequence sequenceName="domain_domain_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-12">
<createSequence sequenceName="domain_option_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-13">
<createSequence sequenceName="emailaddr_emailaddr_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-14">
<createSequence sequenceName="emailalias_emailalias_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-15">
<createSequence sequenceName="hive_hive_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-16">
<createSequence sequenceName="inet_addr_inet_addr_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-17">
<createSequence sequenceName="member_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-18">
<createSequence sequenceName="packet_component_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-19">
<createSequence sequenceName="packet_packet_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-20">
<createSequence sequenceName="queue_queue_entry_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-21">
<createSequence sequenceName="queue_task_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-22">
<createSequence sequenceName="sepa_mandat_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-23">
<createSequence sequenceName="unixuser_unixuser_id_seq"/>
</changeSet>
<changeSet author="HSDB" id="generated-24">
<createTable tableName="basecomponent">
<column autoIncrement="true" name="basecomponent_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="pk_basecomponent"/>
</column>
<column name="basecomponent_code" type="VARCHAR(10)">
<constraints nullable="false"/>
</column>
<column name="description" type="VARCHAR(100)">
<constraints nullable="false"/>
</column>
<column name="sorting" type="INT">
<constraints nullable="false"/>
</column>
<column name="valid" type="BOOLEAN">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-25">
<createTable tableName="basepacket">
<column autoIncrement="true" name="basepacket_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="pk_basepacket"/>
</column>
<column name="basepacket_code" type="VARCHAR(10)">
<constraints nullable="false"/>
</column>
<column name="description" type="VARCHAR(100)">
<constraints nullable="false"/>
</column>
<column name="sorting" type="INT">
<constraints nullable="false"/>
</column>
<column name="valid" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="article_number" type="INT">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-26">
<createTable tableName="business_partner">
<column autoIncrement="true" name="bp_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="pk_business_partner"/>
</column>
<column name="member_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="member_code" type="VARCHAR(20)">
<constraints nullable="false"/>
</column>
<column name="member_since" type="date"/>
<column name="member_until" type="date"/>
<column name="member_role" type="VARCHAR(100)"/>
<column name="author_contract" type="date"/>
<column name="nondisc_contract" type="date"/>
<column name="shares_updated" type="date"/>
<column name="shares_signed" type="INT">
<constraints nullable="false"/>
</column>
<column name="uid_vat" type="VARCHAR(20)"/>
<column defaultValueBoolean="false" name="free" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column defaultValue="GROSS" name="indicator_vat" type="VARCHAR(20)">
<constraints nullable="false"/>
</column>
<column defaultValueBoolean="false" name="exempt_vat" type="BOOLEAN">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-27">
<createTable tableName="component">
<column name="basepacket_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="basecomponent_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="min_quantity" type="INT">
<constraints nullable="false"/>
</column>
<column name="max_quantity" type="INT">
<constraints nullable="false"/>
</column>
<column name="default_quantity" type="INT">
<constraints nullable="false"/>
</column>
<column name="increment_quantity" type="INT">
<constraints nullable="false"/>
</column>
<column name="include_quantity" type="INT">
<constraints nullable="false"/>
</column>
<column name="admin_only" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="article_number" type="INT">
<constraints nullable="false"/>
</column>
<column autoIncrement="true" name="component_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="pk_component"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-28">
<createTable tableName="contact">
<column autoIncrement="true" name="contact_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="pk_contact"/>
</column>
<column name="bp_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="salut" type="VARCHAR(30)"/>
<column name="first_name" type="VARCHAR(40)">
<constraints nullable="false"/>
</column>
<column name="last_name" type="VARCHAR(40)">
<constraints nullable="false"/>
</column>
<column name="title" type="VARCHAR(20)"/>
<column name="firma" type="VARCHAR(120)"/>
<column name="co" type="VARCHAR(50)"/>
<column name="street" type="VARCHAR(50)"/>
<column name="zipcode" type="VARCHAR(10)"/>
<column name="city" type="VARCHAR(40)"/>
<column name="country" type="VARCHAR(30)"/>
<column name="phone_private" type="VARCHAR(30)"/>
<column name="phone_office" type="VARCHAR(30)"/>
<column name="phone_mobile" type="VARCHAR(30)"/>
<column name="fax" type="VARCHAR(30)"/>
<column name="email" type="VARCHAR(100)">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-29">
<createTable tableName="contactrole_ref">
<column name="contact_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="role" type="VARCHAR(40)">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-30">
<createTable tableName="database">
<column autoIncrement="true" name="database_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="pk_database"/>
</column>
<column name="engine" type="VARCHAR(12)">
<constraints nullable="false"/>
</column>
<column name="packet_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="name" type="VARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="owner" type="VARCHAR(24)">
<constraints nullable="false"/>
</column>
<column name="encoding" type="VARCHAR(12)">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-31">
<createTable tableName="database_user">
<column autoIncrement="true" name="dbuser_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="pk_database_user"/>
</column>
<column name="engine" type="VARCHAR(12)">
<constraints nullable="false"/>
</column>
<column name="packet_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="name" type="VARCHAR(64)">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-32">
<createTable tableName="domain">
<column name="domain_name" type="VARCHAR(256)">
<constraints nullable="false"/>
</column>
<column name="domain_since" type="date"/>
<column name="domain_dns_master" type="VARCHAR(64)"/>
<column autoIncrement="true" name="domain_id" type="SERIAL">
<constraints nullable="false"/>
</column>
<column name="domain_owner" type="INT">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-33">
<createTable tableName="domain__domain_option">
<column name="domain_option_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="domain_id" type="INT">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-34">
<createTable tableName="domain_option">
<column autoIncrement="true" name="domain_option_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="pk_domain_option"/>
</column>
<column name="domain_option_name" type="VARCHAR(50)">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-35">
<createTable tableName="emailaddr">
<column autoIncrement="true" name="emailaddr_id" type="SERIAL">
<constraints nullable="false"/>
</column>
<column name="localpart" type="VARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="domain_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="target" type="TEXT"/>
<column name="subdomain" type="VARCHAR(64)"/>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-36">
<createTable tableName="emailalias">
<column autoIncrement="true" name="emailalias_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="emailalias_pkey"/>
</column>
<column name="pac_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="target" type="TEXT">
<constraints nullable="false"/>
</column>
<column name="name" type="VARCHAR(96)">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-37">
<createTable tableName="hive">
<column autoIncrement="true" name="hive_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="pk_hive"/>
</column>
<column name="hive_name" type="VARCHAR(3)">
<constraints nullable="false"/>
</column>
<column name="inet_addr_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="description" type="VARCHAR(100)"/>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-38">
<createTable tableName="inet_addr">
<column autoIncrement="true" name="inet_addr_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="pk_inet_addr"/>
</column>
<column name="inet_addr" type="INET">
<constraints nullable="false"/>
</column>
<column name="description" type="VARCHAR(100)"/>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-39">
<createTable tableName="packet">
<column autoIncrement="true" name="packet_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="pk_packet"/>
</column>
<column name="packet_name" type="VARCHAR(5)">
<constraints nullable="false"/>
</column>
<column name="bp_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="hive_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="created" type="date">
<constraints nullable="false"/>
</column>
<column name="cancelled" type="date"/>
<column name="cur_inet_addr_id" type="INT"/>
<column name="old_inet_addr_id" type="INT"/>
<column defaultValueBoolean="false" name="free" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="basepacket_id" type="INT"/>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-40">
<createTable tableName="packet_component">
<column name="basecomponent_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="packet_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="quantity" type="INT">
<constraints nullable="false"/>
</column>
<column name="created" type="date"/>
<column name="cancelled" type="date"/>
<column autoIncrement="true" name="packet_component_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="pk_packet_component"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-41">
<createTable tableName="price">
<column autoIncrement="true" name="id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="price_pkey"/>
</column>
<column name="article_number" type="INT">
<constraints nullable="false"/>
</column>
<column name="price" type="numeric(10, 2)">
<constraints nullable="false"/>
</column>
<column name="vat" type="numeric(4, 2)">
<constraints nullable="false"/>
</column>
<column name="price_list" type="INT"/>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-42">
<createTable tableName="price_list">
<column autoIncrement="true" name="id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="price_list_pkey"/>
</column>
<column name="name" type="VARCHAR(20)"/>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-43">
<createTable tableName="pricelist_ref">
<column name="bp_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="price_list" type="VARCHAR(40)">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-44">
<createTable tableName="queue">
<column autoIncrement="true" name="queue_entry_id" type="SERIAL">
<constraints nullable="false"/>
</column>
<column name="user_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="started" type="TIMESTAMP(6) WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="finished" type="TIMESTAMP(6) WITHOUT TIME ZONE"/>
<column name="title" type="VARCHAR(192)"/>
<column name="details" type="TEXT"/>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-45">
<createTable tableName="queue_task">
<column autoIncrement="true" name="task_id" type="SERIAL">
<constraints nullable="false"/>
</column>
<column name="proc" type="BYTEA"/>
<column name="exception" type="TEXT"/>
<column name="started" type="TIMESTAMP(6) WITHOUT TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="finished" type="TIMESTAMP(6) WITHOUT TIME ZONE"/>
<column name="title" type="VARCHAR(192)"/>
<column name="details" type="TEXT"/>
<column name="user_id" type="INT"/>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-46">
<createTable tableName="role">
<column name="role_name" type="VARCHAR(40)">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-47">
<createTable tableName="sepa_mandat">
<column autoIncrement="true" name="sepa_mandat_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="pk_sepa_mandat"/>
</column>
<column name="bp_id" type="INT">
<constraints nullable="false"/>
</column>
<column name="bank_customer" type="VARCHAR(50)">
<constraints nullable="false"/>
</column>
<column name="bank_name" type="VARCHAR(50)"/>
<column name="bank_iban" type="VARCHAR(40)">
<constraints nullable="false"/>
</column>
<column name="bank_bic" type="VARCHAR(40)">
<constraints nullable="false"/>
</column>
<column name="mandat_ref" type="VARCHAR(40)">
<constraints nullable="false"/>
</column>
<column name="mandat_signed" type="date">
<constraints nullable="false"/>
</column>
<column name="mandat_since" type="date">
<constraints nullable="false"/>
</column>
<column name="mandat_used" type="date"/>
<column name="mandat_until" type="date"/>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-48">
<createTable tableName="unixuser">
<column autoIncrement="true" name="unixuser_id" type="SERIAL">
<constraints primaryKey="true" primaryKeyName="pk_unixuser"/>
</column>
<column name="name" type="VARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="comment" type="VARCHAR(128)"/>
<column name="shell" type="VARCHAR(64)">
<constraints nullable="false"/>
</column>
<column name="homedir" type="VARCHAR(128)">
<constraints nullable="false"/>
</column>
<column name="locked" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="packet_id" type="INT">
<constraints nullable="false"/>
</column>
<column defaultValueNumeric="0" name="quota_softlimit" type="INT">
<constraints nullable="false"/>
</column>
<column name="userid" type="INT">
<constraints nullable="false"/>
</column>
<column defaultValueNumeric="0" name="quota_hardlimit" type="INT"/>
</createTable>
</changeSet>
<changeSet author="HSDB" id="generated-49">
<addPrimaryKey columnNames="contact_id, role" constraintName="pk_contactrole_ref" tableName="contactrole_ref"/>
</changeSet>
<changeSet author="HSDB" id="generated-50">
<addPrimaryKey columnNames="domain_option_id, domain_id" constraintName="pk_domain__domain_option" tableName="domain__domain_option"/>
</changeSet>
<changeSet author="HSDB" id="generated-51">
<addPrimaryKey columnNames="role_name" constraintName="pk_role" tableName="role"/>
</changeSet>
<changeSet author="HSDB" id="generated-52">
<addUniqueConstraint columnNames="bp_id" constraintName="business_partner_bp_id_key" tableName="business_partner"/>
</changeSet>
<changeSet author="HSDB" id="generated-53">
<addUniqueConstraint columnNames="engine, name" constraintName="database_uniq" tableName="database"/>
</changeSet>
<changeSet author="HSDB" id="generated-54">
<addUniqueConstraint columnNames="engine, name" constraintName="database_user_uniq" tableName="database_user"/>
</changeSet>
<changeSet author="HSDB" id="generated-55">
<addUniqueConstraint columnNames="localpart, subdomain, domain_id" constraintName="emailaddr_uniq" tableName="emailaddr"/>
</changeSet>
<changeSet author="HSDB" id="generated-56">
<addUniqueConstraint columnNames="name" constraintName="emailalias_uniq" tableName="emailalias"/>
</changeSet>
<changeSet author="HSDB" id="generated-57">
<addUniqueConstraint columnNames="name" constraintName="price_list_uniq_name" tableName="price_list"/>
</changeSet>
<changeSet author="HSDB" id="generated-58">
<addUniqueConstraint columnNames="name" constraintName="unixuser_name_key" tableName="unixuser"/>
</changeSet>
<changeSet author="HSDB" id="generated-59">
<createIndex indexName="basecomponent_in_1" tableName="basecomponent" unique="true">
<column name="basecomponent_code"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-60">
<createIndex indexName="basepacket_in_1" tableName="basepacket" unique="true">
<column name="basepacket_code"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-61">
<createIndex indexName="component_in_1" tableName="component">
<column name="basecomponent_id"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-62">
<createIndex indexName="contact_in_1" tableName="contact">
<column name="bp_id"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-63">
<createIndex indexName="customer_in_1" tableName="business_partner" unique="true">
<column name="member_code"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-64">
<createIndex indexName="customer_in_2" tableName="business_partner" unique="true">
<column name="member_id"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-65">
<createIndex indexName="database_unique_owner" tableName="database_user" unique="true">
<column name="name"/>
<column name="engine"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-66">
<createIndex indexName="domain_option_name_idx" tableName="domain_option" unique="true">
<column name="domain_option_name"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-67">
<createIndex indexName="domain_unique_id" tableName="domain" unique="true">
<column name="domain_id"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-68">
<createIndex indexName="domain_unique_name" tableName="domain" unique="true">
<column name="domain_name"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-69">
<createIndex indexName="emailaddr_uniq2" tableName="emailaddr" unique="true">
<column computed="true" name="(subdomain IS NULL)"/>
<column computed="true" name="(subdomain IS NULL)"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-70">
<createIndex indexName="hive_in_1" tableName="hive" unique="true">
<column name="hive_name"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-71">
<createIndex indexName="inet_addr_in_1" tableName="inet_addr" unique="true">
<column name="inet_addr"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-72">
<createIndex indexName="packet_component_in_1" tableName="packet_component">
<column name="packet_id"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-73">
<createIndex indexName="packet_component_in_2" tableName="packet_component">
<column name="basecomponent_id"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-74">
<createIndex indexName="packet_in_1" tableName="packet" unique="true">
<column name="packet_name"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-75">
<createIndex indexName="packet_in_2" tableName="packet">
<column name="bp_id"/>
</createIndex>
</changeSet>
<changeSet author="HSDB" id="generated-76">
<addForeignKeyConstraint baseColumnNames="basepacket_id" baseTableName="packet" constraintName="base_packet_ref" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="basepacket_id" referencedTableName="basepacket"/>
</changeSet>
<changeSet author="HSDB" id="generated-77">
<addForeignKeyConstraint baseColumnNames="owner,engine" baseTableName="database" constraintName="database_owner" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="name,engine" referencedTableName="database_user"/>
</changeSet>
<changeSet author="HSDB" id="generated-78">
<addForeignKeyConstraint baseColumnNames="packet_id" baseTableName="database" constraintName="database_packet_id_fkey" deferrable="true" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="packet_id" referencedTableName="packet"/>
</changeSet>
<changeSet author="HSDB" id="generated-79">
<addForeignKeyConstraint baseColumnNames="packet_id" baseTableName="database_user" constraintName="dbuser_packet_id_fkey" deferrable="true" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="packet_id" referencedTableName="packet"/>
</changeSet>
<changeSet author="HSDB" id="generated-80">
<addForeignKeyConstraint baseColumnNames="domain_id" baseTableName="domain__domain_option" constraintName="domain_id_fkey" deferrable="true" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="domain_id" referencedTableName="domain"/>
</changeSet>
<changeSet author="HSDB" id="generated-81">
<addForeignKeyConstraint baseColumnNames="domain_option_id" baseTableName="domain__domain_option" constraintName="domain_option_id_fkey" deferrable="true" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="domain_option_id" referencedTableName="domain_option"/>
</changeSet>
<changeSet author="HSDB" id="generated-82">
<addForeignKeyConstraint baseColumnNames="domain_owner" baseTableName="domain" constraintName="domain_owner_chk" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="unixuser_id" referencedTableName="unixuser"/>
</changeSet>
<changeSet author="HSDB" id="generated-83">
<addForeignKeyConstraint baseColumnNames="domain_id" baseTableName="emailaddr" constraintName="email_domain" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="domain_id" referencedTableName="domain"/>
</changeSet>
<changeSet author="HSDB" id="generated-84">
<addForeignKeyConstraint baseColumnNames="pac_id" baseTableName="emailalias" constraintName="emailalias_pac_id_fkey" deferrable="true" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="packet_id" referencedTableName="packet"/>
</changeSet>
<changeSet author="HSDB" id="generated-85">
<addForeignKeyConstraint baseColumnNames="bp_id" baseTableName="sepa_mandat" constraintName="fk_bank_acc_reference_business" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="bp_id" referencedTableName="business_partner"/>
</changeSet>
<changeSet author="HSDB" id="generated-86">
<addForeignKeyConstraint baseColumnNames="basepacket_id" baseTableName="component" constraintName="fk_bcomp_bpack" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="basepacket_id" referencedTableName="basepacket"/>
</changeSet>
<changeSet author="HSDB" id="generated-87">
<addForeignKeyConstraint baseColumnNames="packet_id" baseTableName="packet_component" constraintName="fk_comp_pack" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="packet_id" referencedTableName="packet"/>
</changeSet>
<changeSet author="HSDB" id="generated-88">
<addForeignKeyConstraint baseColumnNames="bp_id" baseTableName="contact" constraintName="fk_contact_reference_business" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="bp_id" referencedTableName="business_partner"/>
</changeSet>
<changeSet author="HSDB" id="generated-89">
<addForeignKeyConstraint baseColumnNames="contact_id" baseTableName="contactrole_ref" constraintName="fk_contactrole_ref_contact" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="contact_id" referencedTableName="contact"/>
</changeSet>
<changeSet author="HSDB" id="generated-90">
<addForeignKeyConstraint baseColumnNames="role" baseTableName="contactrole_ref" constraintName="fk_contactrole_ref_role" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="role_name" referencedTableName="role"/>
</changeSet>
<changeSet author="HSDB" id="generated-91">
<addForeignKeyConstraint baseColumnNames="inet_addr_id" baseTableName="hive" constraintName="fk_hive_inet" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="inet_addr_id" referencedTableName="inet_addr"/>
</changeSet>
<changeSet author="HSDB" id="generated-92">
<addForeignKeyConstraint baseColumnNames="cur_inet_addr_id" baseTableName="packet" constraintName="fk_pac_cur_inet" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="inet_addr_id" referencedTableName="inet_addr"/>
</changeSet>
<changeSet author="HSDB" id="generated-93">
<addForeignKeyConstraint baseColumnNames="old_inet_addr_id" baseTableName="packet" constraintName="fk_pac_old_inet" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="inet_addr_id" referencedTableName="inet_addr"/>
</changeSet>
<changeSet author="HSDB" id="generated-94">
<addForeignKeyConstraint baseColumnNames="bp_id" baseTableName="packet" constraintName="fk_packet_bp" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="bp_id" referencedTableName="business_partner"/>
</changeSet>
<changeSet author="HSDB" id="generated-95">
<addForeignKeyConstraint baseColumnNames="hive_id" baseTableName="packet" constraintName="fk_packet_hive" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="hive_id" referencedTableName="hive"/>
</changeSet>
<changeSet author="HSDB" id="generated-96">
<addForeignKeyConstraint baseColumnNames="bp_id" baseTableName="pricelist_ref" constraintName="fk_pricelist_ref_bp" deferrable="false" initiallyDeferred="false" onDelete="CASCADE" onUpdate="RESTRICT" referencedColumnNames="bp_id" referencedTableName="business_partner"/>
</changeSet>
<changeSet author="HSDB" id="generated-97">
<addForeignKeyConstraint baseColumnNames="price_list" baseTableName="pricelist_ref" constraintName="fk_pricelist_ref_pricelist" deferrable="false" initiallyDeferred="false" onDelete="CASCADE" onUpdate="RESTRICT" referencedColumnNames="name" referencedTableName="price_list"/>
</changeSet>
<changeSet author="HSDB" id="generated-98">
<addForeignKeyConstraint baseColumnNames="basecomponent_id" baseTableName="component" constraintName="fk_reference_13" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="basecomponent_id" referencedTableName="basecomponent"/>
</changeSet>
<changeSet author="HSDB" id="generated-99">
<addForeignKeyConstraint baseColumnNames="price_list" baseTableName="price" constraintName="price_price_list_fkey" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="id" referencedTableName="price_list"/>
</changeSet>
<changeSet author="HSDB" id="generated-100">
<addForeignKeyConstraint baseColumnNames="user_id" baseTableName="queue_task" constraintName="queue_task_user_id_fkey" deferrable="false" initiallyDeferred="false" onDelete="SET NULL" onUpdate="NO ACTION" referencedColumnNames="unixuser_id" referencedTableName="unixuser"/>
</changeSet>
<changeSet author="HSDB" id="generated-101">
<addForeignKeyConstraint baseColumnNames="user_id" baseTableName="queue" constraintName="queue_user_id_fkey" deferrable="true" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="unixuser_id" referencedTableName="unixuser"/>
</changeSet>
</databaseChangeLog>

View File

@ -0,0 +1,7 @@
changeLogFile=target/classes/liquibase/db.changelog.xml
driver=org.postgresql.Driver
url=jdbc:postgresql://localhost:5432/hsadmin_migdb
username=hsadmin_dbuser
password=SelfDefinedPassword
verbose=true
dropFirst=false

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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_3_0.xsd"
version="3.0">
<context-param>
<param-name>liquibase.changelog</param-name>
<param-value>liquibase/db.changelog.xml</param-value>
</context-param>
<context-param>
<param-name>liquibase.datasource</param-name>
<param-value>java:comp/env/jdbc/hsar-ds</param-value>
</context-param>
<context-param>
<param-name>liquibase.onerror.fail</param-name>
<param-value>true</param-value>
</context-param>
<listener>
<listener-class>liquibase.integration.servlet.LiquibaseServletListener</listener-class>
</listener>
<resource-ref>
<res-ref-name>jdbc/hsar-ds</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
</resource-ref>
</web-app>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<tomee>
<Resource id="hsar-ds" type="javax.sql.DataSource">
JdbcDriver = org.postgresql.Driver
JdbcUrl = jdbc:postgresql://localhost:5432/hsadmin_migdb
UserName = hsadmin_dbuser
Password = SelfDefinedPassword
</Resource>
</tomee>

View File

@ -14,8 +14,10 @@
<module>framework</module> <module>framework</module>
<module>services</module> <module>services</module>
<module>xmlrpc</module> <module>xmlrpc</module>
<module>cust-services</module>
<module>web</module> <module>web</module>
<module>cli</module> <module>cli</module>
<module>db-migration</module>
</modules> </modules>
<build> <build>