Fix validation of sequence parameters. Fixes #3014

pull/8/head
Murtuza Zabuawala 2018-02-21 17:32:04 +00:00 committed by Dave Page
parent b49d625c2d
commit f8771d5585
1 changed files with 15 additions and 17 deletions

View File

@ -1,18 +1,16 @@
{% if data %}
CREATE SEQUENCE {{ conn|qtIdent(data.schema) }}.{{ conn|qtIdent(data.name) }}
{% if data.cycled and data.cycled == True %}
CYCLE
{% endif %}
{% if data.increment is defined %}
INCREMENT {{data.increment}}
{% endif %}{% if data.start is defined %}
START {{data.start}}
{% elif data.current_value is defined %}
START {{data.current_value}}
{% endif %}{% if data.minimum is defined %}
MINVALUE {{data.minimum}}
{% endif %}{% if data.maximum is defined %}
MAXVALUE {{data.maximum}}
{% endif %}{% if data.cache is defined %}
CREATE SEQUENCE {{ conn|qtIdent(data.schema, data.name) }}{% if data.increment is defined and data.cycled %}
CYCLE{% endif %}{% if data.increment is defined and data.increment is number %}
INCREMENT {{data.increment}}{% endif %}{% if data.start is defined and data.start is number %}
START {{data.start}}{% elif data.current_value is defined and data.current_value is number %}
START {{data.current_value}}{% endif %}{% if data.minimum is defined and data.minimum is number %}
MINVALUE {{data.minimum}}{% endif %}{% if data.maximum is defined and data.maximum is number %}
MAXVALUE {{data.maximum}}{% endif %}{% if data.cache is defined and data.cache is number %}
CACHE {{data.cache}}{% endif %};
{% endif %}