]> WPIA git - gigi.git/commitdiff
chg: remove csr_name and crt_name columns from certs
authorFelix Dörre <felix@dogcraft.de>
Sat, 4 Nov 2017 23:25:22 +0000 (00:25 +0100)
committerFelix Dörre <felix@dogcraft.de>
Tue, 7 Nov 2017 14:04:28 +0000 (15:04 +0100)
Change-Id: I46ae11f8a158547f4b1c1e1ddf062f6016e36af0

src/club/wpia/gigi/database/DatabaseConnection.java
src/club/wpia/gigi/database/tableStructure.sql
src/club/wpia/gigi/database/upgrade/from_32.sql [new file with mode: 0644]
util-testing/club/wpia/gigi/localisation/TranslationCollector.java

index c8bb43997966e6bbba604983dbfb7905e6d2a67c..20125a81e0f54420e79508244eae7d05bf0fbdad 100644 (file)
@@ -181,7 +181,7 @@ public class DatabaseConnection {
 
     }
 
-    public static final int CURRENT_SCHEMA_VERSION = 32;
+    public static final int CURRENT_SCHEMA_VERSION = 33;
 
     public static final int CONNECTION_TIMEOUT = 24 * 60 * 60;
 
index 41da72a3ed9b5565268d8dcc90a74dcced199373..bf457af37f3ee6acbac12fa65281677bdbd6f9e1 100644 (file)
@@ -156,9 +156,7 @@ CREATE TABLE "certs" (
   "profile" int NOT NULL,
   "caid" int NULL DEFAULT NULL,
 
-  "csr_name" varchar(255) NOT NULL DEFAULT '',
   "csr_type" "csrType" NOT NULL,
-  "crt_name" varchar(255) NOT NULL DEFAULT '',
   "created" timestamp NULL DEFAULT NULL,
   "modified" timestamp NULL DEFAULT NULL,
 
@@ -181,7 +179,6 @@ CREATE INDEX ON "certs" ("created");
 CREATE INDEX ON "certs" ("memid");
 CREATE INDEX ON "certs" ("serial");
 CREATE INDEX ON "certs" ("expire");
-CREATE INDEX ON "certs" ("crt_name");
 
 DROP TABLE IF EXISTS "certAvas";
 CREATE TABLE "certAvas" (
@@ -381,7 +378,7 @@ CREATE TABLE "schemeVersion" (
   "version" smallint NOT NULL,
   PRIMARY KEY ("version")
 );
-INSERT INTO "schemeVersion" (version)  VALUES(32);
+INSERT INTO "schemeVersion" (version)  VALUES(33);
 
 DROP TABLE IF EXISTS `passwordResetTickets`;
 CREATE TABLE `passwordResetTickets` (
diff --git a/src/club/wpia/gigi/database/upgrade/from_32.sql b/src/club/wpia/gigi/database/upgrade/from_32.sql
new file mode 100644 (file)
index 0000000..6cee9bb
--- /dev/null
@@ -0,0 +1,2 @@
+ALTER TABLE "certs" DROP COLUMN "csr_name";
+ALTER TABLE "certs" DROP COLUMN "crt_name";
index 239c32fb7ce9a5a42330882b11ed288f677a091b..2883efd0d5042b8a05ff437171f7954fd2beacf3 100644 (file)
@@ -219,7 +219,10 @@ public class TranslationCollector {
                     throw new Error();
                 }
             }
-
+            // Skip Database connection as some statements need to be run on older DB scheme version.
+            if(new String(parsedUnit.getFileName()).endsWith("/src/club/wpia/gigi/database/DatabaseConnection.java")) {
+                continue;
+            }
             if (parsedUnit.types == null) {
                 System.err.println("No types");