This commit is contained in:
yumoqing 2020-05-11 12:13:36 +08:00
parent 94bf65620f
commit 777b15e5f8
4 changed files with 9 additions and 15 deletions

View File

@ -31,11 +31,9 @@ NOT NULL
{%- endif -%}
{% endmacro %}
{% macro primary() %}
{% if len(','.join(summary[0].primary))>0 %}
,primary key({{','.join(summary[0].primary)}})
{% endif %}
,primary key({{summary[0].primary}})
{% endmacro %}
drop table {{summary[0].name}};
drop table if exists {{summary[0].name}};
CREATE TABLE {{summary[0].name}}
(
{% for field in fields %}

View File

@ -25,9 +25,7 @@ NOT NULL
{%- endif -%}
{% endmacro %}
{% macro primary() %}
{% if len(','.join(summary[0].primary))>0 %}
,primary key({{','.join(summary[0].primary)}})
{% endif %}
,primary key({{summary[0].primary}})
{% endmacro %}
drop table {{summary[0].name}};
CREATE TABLE {{summary[0].name}}

View File

@ -23,7 +23,7 @@ NOT NULL
{%- endif -%}
{% endmacro %}
{% macro primary() %}
primary key({{','.join(summary[0].primary)}})
primary key({{summary[0].primary}})
{% endmacro %}
DROP TABLE IF EXISTS {{summary[0].name}};
CREATE TABLE {{summary[0].name}}

View File

@ -26,9 +26,7 @@ NOT NULL
{% endmacro %}
{% macro primary() %}
{% if len(','.join(summary[0].primary))>0 %}
,primary key({{','.join(summary[0].primary)}})
{% endif %}
,primary key({{summary[0].primary}})
{% endmacro %}
drop table dbo.{{summary[0].name}};