From 99c1ef35be77d946244bf0e1d55bc94e14c6f2ab Mon Sep 17 00:00:00 2001
From: charlesr <charlesr>
Date: Tue, 8 Jan 2008 17:39:03 +0000
Subject: [PATCH] change: - move 'create index' section up to follow 'create
 table' section add: - 'check constraint' section

SVN: 3360
---
 .../cisd/dbmigration/DBScriptFormatter.java   | 23 ++++++++++++-------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/dbmigration/source/java/ch/systemsx/cisd/dbmigration/DBScriptFormatter.java b/dbmigration/source/java/ch/systemsx/cisd/dbmigration/DBScriptFormatter.java
index eab62df2a77..3a85275b14b 100644
--- a/dbmigration/source/java/ch/systemsx/cisd/dbmigration/DBScriptFormatter.java
+++ b/dbmigration/source/java/ch/systemsx/cisd/dbmigration/DBScriptFormatter.java
@@ -52,6 +52,14 @@ public class DBScriptFormatter
     {
         CREATE_DOMAIN("Creating domains", "CREATE DOMAIN "), 
         CREATE_TABLE("Creating tables", "CREATE TABLE "),
+        CREATE_SEQUENCE("Creating sequences", "CREATE SEQUENCE ",
+                new ILineProcessor()
+                    {
+                        public String process(String line)
+                        {
+                            return StringUtils.replace(line, " NO MAXVALUE NO MINVALUE NO CYCLE", "");
+                        }
+                    }), 
         PRIMARY_KEY_CONSTRAINTS("Creating primary key constraints", new ILineMatcher()
         {
             public boolean match(String line)
@@ -73,14 +81,13 @@ public class DBScriptFormatter
                 return Pattern.matches("ALTER TABLE .+ FOREIGN KEY.+", line);
             }
         }, null), 
-        CREATE_SEQUENCE("Creating sequences", "CREATE SEQUENCE ",
-                new ILineProcessor()
-                    {
-                        public String process(String line)
-                        {
-                            return StringUtils.replace(line, " NO MAXVALUE NO MINVALUE NO CYCLE", "");
-                        }
-                    }), 
+        CHECK_CONSTRAINTS("Creating check constraints", new ILineMatcher()
+        {
+            public boolean match(String line)
+            {
+                return Pattern.matches("ALTER TABLE .+ CHECK.+", line);
+            }
+        }, null), 
         CREATE_INDEX("Creating indices", "CREATE INDEX "), 
         MISC("Miscellaneous", new ILineMatcher()
             {
-- 
GitLab