jp.co.tis.gsp.tools.db.template.h2.createIndex.ftl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gsp-dba-maven-plugin Show documentation
Show all versions of gsp-dba-maven-plugin Show documentation
To automate the routine work of the DBA, it is a tool to be able to concentrate on the data modeling work.
<#-- IDENTITY型に対してALTER TABLEでPKを付与しようとするとエラーが発生するため、PKは一律CREATE TABLEで付与する -->
<#if !index.isPrimaryKey()>
<#if index.type=1>
ALTER TABLE <#if entity.schema?has_content>${entity.schema}.#if>${entity.name} ADD CONSTRAINT ${index.name!} UNIQUE
<#elseif index.type=2 || index.type=3>
CREATE <#if index.type=2>UNIQUE #if>INDEX <#if entity.schema?has_content>${entity.schema}.#if>${index.name} ON <#if entity.schema?has_content>${entity.schema}.#if>${entity.name}
#if>
(
<#foreach column in index.columnList>
${column.name}<#if column_has_next>,#if>
#foreach>
);
#if>