bugfix
This commit is contained in:
parent
246ebad120
commit
7b99ce052c
@ -25,6 +25,11 @@ longblob
|
|||||||
{{type}}
|
{{type}}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
|
||||||
|
{%- macro defaultValue(defaultv) %}
|
||||||
|
{%- if defaultv %} DEFAULT '{{defaultv}}'{%- endif -%}
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
{% macro nullStr(nullable) %}
|
{% macro nullStr(nullable) %}
|
||||||
{%- if nullable=='no' -%}
|
{%- if nullable=='no' -%}
|
||||||
NOT NULL
|
NOT NULL
|
||||||
@ -37,7 +42,7 @@ drop table if exists {{summary[0].name}};
|
|||||||
CREATE TABLE {{summary[0].name}}
|
CREATE TABLE {{summary[0].name}}
|
||||||
(
|
(
|
||||||
{% for field in fields %}
|
{% for field in fields %}
|
||||||
`{{field.name}}` {{typeStr(field.type,field.length,field.dec)}} {{nullStr(field.nullable)}} {%if field.title -%} comment '{{field.title}}'{%- endif %}{%- if not loop.last -%},{%- endif -%}
|
`{{field.name}}` {{typeStr(field.type,field.length,field.dec)}} {{nullStr(field.nullable)}} {{defaultValue(field.default)}} {%if field.title -%} comment '{{field.title}}'{%- endif %}{%- if not loop.last -%},{%- endif -%}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if summary[0].primary and len(summary[0].primary)>0 %}
|
{% if summary[0].primary and len(summary[0].primary)>0 %}
|
||||||
{{primary()}}
|
{{primary()}}
|
||||||
|
Loading…
Reference in New Issue
Block a user