aboutsummaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorJames Moger <james.moger@gmail.com>2012-09-21 07:59:04 -0400
committerJames Moger <james.moger@gmail.com>2012-09-21 07:59:04 -0400
commit53bc79dbe434e61765356ff193ac4665947c32a0 (patch)
treef0a17e32bf1ac05cfc39fed9e6ebf185a0dd8582 /src/com
parenta1f55e4a587fd8e6ef3f4b5365348ea59b00329c (diff)
downloadiciql-53bc79dbe434e61765356ff193ac4665947c32a0.tar.gz
iciql-53bc79dbe434e61765356ff193ac4665947c32a0.zip
Fixed order of DEFAULT in create table statement (issue 11)
Diffstat (limited to 'src/com')
-rw-r--r--src/com/iciql/SQLDialectDefault.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/iciql/SQLDialectDefault.java b/src/com/iciql/SQLDialectDefault.java
index 617bffb..7cc6bd7 100644
--- a/src/com/iciql/SQLDialectDefault.java
+++ b/src/com/iciql/SQLDialectDefault.java
@@ -134,10 +134,6 @@ public class SQLDialectDefault implements SQLDialect {
field.isAutoIncrement, field.isPrimaryKey);
}
- if (!field.nullable) {
- buff.append(" NOT NULL");
- }
-
// default values
if (!field.isAutoIncrement && !field.isPrimaryKey) {
String dv = field.defaultValue;
@@ -148,6 +144,10 @@ public class SQLDialectDefault implements SQLDialect {
}
}
}
+
+ if (!field.nullable) {
+ buff.append(" NOT NULL");
+ }
}
// if table does not have identity column then specify primary key