CreateSequenceSql: Explicitly start sequences with 1
Different database dialects start sequences with different values. Make
the starting value explicit.
Change-Id: I508f87931a8ab98426ebc0cd791e7edda121bb6d
diff --git a/src/main/java/com/google/gwtorm/schema/sql/SqlDialect.java b/src/main/java/com/google/gwtorm/schema/sql/SqlDialect.java
index 3c68117..66f444d 100644
--- a/src/main/java/com/google/gwtorm/schema/sql/SqlDialect.java
+++ b/src/main/java/com/google/gwtorm/schema/sql/SqlDialect.java
@@ -192,10 +192,12 @@
r.append("CREATE SEQUENCE ");
r.append(seq.getSequenceName());
- if (s.startWith() > 0) {
- r.append(" START WITH ");
- r.append(s.startWith());
- }
+ /*
+ * Some gwtorm users seems to imply a start of 1, enforce this constraint
+ * here explicitly
+ */
+ r.append(" START WITH ");
+ r.append(s.startWith() > 0 ? s.startWith() : 1);
if (s.cache() > 0) {
r.append(" CACHE ");