#609 - SQLite DDL - disable use of comments and alter table add foreign key (as these are not supported by SQLite)

This commit is contained in:
Robin Bygrave
2016-03-21 10:31:57 +13:00
parent fc70161909
commit 49b8efbc30
2 changed files with 23 additions and 2 deletions
@@ -309,7 +309,10 @@ public class BaseTableDdl implements TableDdl {
protected void alterTableAddForeignKey(DdlBuffer buffer, String fkName, String tableName, String[] columns, String refTable, String[] refColumns) throws IOException {
buffer.append(platformDdl.alterTableAddForeignKey(tableName, fkName, columns, refTable, refColumns)).endOfStatement();
String fkConstraint = platformDdl.alterTableAddForeignKey(tableName, fkName, columns, refTable, refColumns);
if (fkConstraint != null && !fkConstraint.isEmpty()) {
buffer.append(fkConstraint).endOfStatement();
}
}
protected void appendColumns(String[] columns, DdlBuffer buffer) throws IOException {
@@ -2,6 +2,9 @@ package com.avaje.ebean.dbmigration.ddlgeneration.platform;
import com.avaje.ebean.config.dbplatform.DbIdentity;
import com.avaje.ebean.config.dbplatform.DbTypeMap;
import com.avaje.ebean.dbmigration.ddlgeneration.DdlBuffer;
import java.io.IOException;
/**
* DB2 platform specific DDL.
@@ -12,5 +15,20 @@ public class SQLiteDdl extends PlatformDdl {
super(platformTypes, dbIdentity);
this.identitySuffix = "";
}
@Override
public void addTableComment(DdlBuffer apply, String tableName, String tableComment) throws IOException {
// not supported
}
@Override
public void addColumnComment(DdlBuffer apply, String table, String column, String comment) throws IOException {
// not supported
}
@Override
public String alterTableAddForeignKey(String tableName, String fkName, String[] columns, String refTable, String[] refColumns) {
// not supported
return null;
}
}