From f9c969cb92715dc1a1902ad2d5640f93c8522965 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@hostsharing.net>
Date: Fri, 25 Mar 2011 18:37:16 +0100
Subject: [PATCH] drop tables

---
 hsarback/database/schema.sql     |   22 -----------
 hsarback/build.xml               |   19 +++++++--
 hsarback/database/dropschema.sql |   34 +++++++++++++++++
 3 files changed, 49 insertions(+), 26 deletions(-)

diff --git a/hsarback/build.xml b/hsarback/build.xml
index b891cfb..9740ed6 100644
--- a/hsarback/build.xml
+++ b/hsarback/build.xml
@@ -7,6 +7,8 @@
 	<property name="src.home" value="${basedir}/src" />
 	<property name="dist.home" value="${basedir}/dist" />
 
+	<property file="${user.home}/.hsar.ant.properties" />
+	
 	<!-- Optionen  für Java-Compiler-->
 	<property name="compile.debug" value="true" />
 	<property name="compile.deprecation" value="true" />
@@ -74,15 +76,24 @@
 		<sql
 			classpath="/usr/share/java/postgresql-jdbc3-8.2.jar"
 			driver="org.postgresql.Driver" 
-			url="jdbc:postgresql://localhost:5432/hsh02_hsdb1" 
-			userid="hsh02_hsdb" password="Phoh9t" 
+			url="jdbc:postgresql://localhost:5432/${database.name}"
+			userid="${database.user}" password="${database.password}" 
 			src="database/schema.sql" />		
 		<sql
 			classpath="/usr/share/java/postgresql-jdbc3-8.2.jar"
 			driver="org.postgresql.Driver" 
-			url="jdbc:postgresql://localhost:5432/hsh02_hsdb1" 
-			userid="hsh02_hsdb" password="Phoh9t" 
+			url="jdbc:postgresql://localhost:5432/${database.name}"
+			userid="${database.user}" password="${database.password}" 
 			src="database/data.sql" />		
 	</target>
 	
+	<target name="drop-db" description="make empty database">
+		<sql
+			classpath="/usr/share/java/postgresql-jdbc3-8.2.jar"
+			driver="org.postgresql.Driver" 
+			url="jdbc:postgresql://localhost:5432/${database.name}"
+			userid="${database.user}" password="${database.password}" 
+			src="database/dropschema.sql" />		
+	</target>
+	
 </project>
diff --git a/hsarback/database/dropschema.sql b/hsarback/database/dropschema.sql
new file mode 100644
index 0000000..139a193
--- /dev/null
+++ b/hsarback/database/dropschema.sql
@@ -0,0 +1,34 @@
+DROP TABLE bank_account ;
+DROP SEQUENCE bank_account_bank_account_id_seq ;
+DROP TABLE billdata ;
+DROP SEQUENCE billdata_billdata_id_seq ;
+DROP TABLE contact ;
+DROP SEQUENCE contact_contact_id_seq ;
+DROP TABLE database ;
+DROP TABLE database_user ;
+DROP SEQUENCE database_database_id_seq ;
+DROP SEQUENCE dbuser_dbuser_id_seq ;
+DROP TABLE emailaddr ;
+DROP SEQUENCE emailaddr_emailaddr_id_seq ;
+DROP TABLE emailalias ;
+DROP SEQUENCE  emailalias_emailalias_id_seq ;
+DROP TABLE queue_task ;
+DROP SEQUENCE queue_task_id_seq ;
+DROP TABLE domain ;
+DROP SEQUENCE domain_domain_id_seq ;
+DROP TABLE unixuser ;
+DROP SEQUENCE unixuser_unixuser_id_seq ;
+DROP TABLE packet_component ;
+DROP TABLE component ;
+DROP TABLE basecomponent ;
+DROP TABLE basepacket ;
+DROP SEQUENCE basecomponent_basecomponent_seq ;
+DROP SEQUENCE basepacket_basepacket_id_seq ;
+DROP TABLE packet ;
+DROP SEQUENCE packet_packet_id_seq ;
+DROP TABLE hive ;
+DROP SEQUENCE hive_hive_id_seq ;
+DROP TABLE inet_addr ;
+DROP SEQUENCE inet_addr_inet_addr_id_seq ;
+DROP TABLE business_partner ;
+DROP SEQUENCE business_partner_bp_id_seq ;
diff --git a/hsarback/database/schema.sql b/hsarback/database/schema.sql
index 36a6e63..947c22c 100644
--- a/hsarback/database/schema.sql
+++ b/hsarback/database/schema.sql
@@ -17,17 +17,6 @@
 
 
 --
--- Name: bank_account_bank_account_i_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE bank_account_bank_account_i_seq
-    INCREMENT BY 1
-    NO MAXVALUE
-    NO MINVALUE
-    CACHE 1;
-
-
---
 -- Name: bank_account_bank_account_id_seq; Type: SEQUENCE; Schema: public; Owner: -
 --
 
@@ -375,17 +364,6 @@
     INCREMENT BY 1
     NO MAXVALUE
     NO MINVALUE
-    CACHE 1;
-
-
---
--- Name: member_id_seq; Type: SEQUENCE; Schema: public; Owner: -
---
-
-CREATE SEQUENCE member_id_seq
-    INCREMENT BY 1
-    MAXVALUE 99999
-    MINVALUE 10200
     CACHE 1;
 
 

--
Gitblit v1.9.0-SNAPSHOT