Fix validation of sequence parameters. Fixes #3014

This commit is contained in:
Murtuza Zabuawala 2018-02-21 17:32:04 +00:00 committed by Dave Page
parent b49d625c2d
commit f8771d5585

View File

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