]> WPIA git - gigi.git/commitdiff
db_update: db changes related to issue #25 in table organisations
authorINOPIAE <m.maengel@inopiae.de>
Thu, 16 Jun 2016 09:26:15 +0000 (11:26 +0200)
committerFelix Dörre <felix@dogcraft.de>
Tue, 28 Jun 2016 08:09:01 +0000 (10:09 +0200)
Change-Id: I1f8ec30d036ea2fb948f9397988f5ef494d85076

src/org/cacert/gigi/database/DatabaseConnection.java
src/org/cacert/gigi/database/tableStructure.sql
src/org/cacert/gigi/database/upgrade/from_12.sql [new file with mode: 0644]

index a35197985a76150368edd73ad5d724907c0fc8c4..43b7b748dd700809bb6d8a96f9a015e45e82cbd7 100644 (file)
@@ -122,7 +122,7 @@ public class DatabaseConnection {
 
     }
 
 
     }
 
-    public static final int CURRENT_SCHEMA_VERSION = 12;
+    public static final int CURRENT_SCHEMA_VERSION = 13;
 
     public static final int CONNECTION_TIMEOUT = 24 * 60 * 60;
 
 
     public static final int CONNECTION_TIMEOUT = 24 * 60 * 60;
 
index ca57e515ccc8b80361372178a745c21a84752611..8a0727d6a308c14031000b028ef01d4112cfcef0 100644 (file)
@@ -36,12 +36,14 @@ CREATE INDEX ON "users" ("verified");
 DROP TABLE IF EXISTS "organisations";
 CREATE TABLE IF NOT EXISTS "organisations" (
   "id" int NOT NULL,
 DROP TABLE IF EXISTS "organisations";
 CREATE TABLE IF NOT EXISTS "organisations" (
   "id" int NOT NULL,
-  "name" varchar(100) NOT NULL,
+  "name" varchar(64) NOT NULL,
   "state" varchar(2) NOT NULL,
   "province" varchar(100) NOT NULL,
   "city" varchar(100) NOT NULL,
   "contactEmail" varchar(100) NOT NULL,
   "creator" int NOT NULL,
   "state" varchar(2) NOT NULL,
   "province" varchar(100) NOT NULL,
   "city" varchar(100) NOT NULL,
   "contactEmail" varchar(100) NOT NULL,
   "creator" int NOT NULL,
+  "optional_name" text,
+  "postal_address" text,
   PRIMARY KEY ("id")
 );
 
   PRIMARY KEY ("id")
 );
 
@@ -372,7 +374,7 @@ CREATE TABLE "schemeVersion" (
   "version" smallint NOT NULL,
   PRIMARY KEY ("version")
 );
   "version" smallint NOT NULL,
   PRIMARY KEY ("version")
 );
-INSERT INTO "schemeVersion" (version)  VALUES(11);
+INSERT INTO "schemeVersion" (version)  VALUES(13);
 
 DROP TABLE IF EXISTS `passwordResetTickets`;
 CREATE TABLE `passwordResetTickets` (
 
 DROP TABLE IF EXISTS `passwordResetTickets`;
 CREATE TABLE `passwordResetTickets` (
diff --git a/src/org/cacert/gigi/database/upgrade/from_12.sql b/src/org/cacert/gigi/database/upgrade/from_12.sql
new file mode 100644 (file)
index 0000000..1035e09
--- /dev/null
@@ -0,0 +1,4 @@
+ALTER TABLE "organisations" ALTER COLUMN  "name" TYPE  varchar(64);
+
+ALTER TABLE "organisations" ADD COLUMN  "optional_name"  text;
+ALTER TABLE "organisations" ADD COLUMN  "postal_address"  text;