Modified SqLite platform to generate at least non failing migration scripts.

Note: If you want to alter a table in SqLite, the best option is to recreate the table with the new layout
This commit is contained in:
Roland Praml committed 2022-02-25 12:07:06 +01:00
1 parent 897a97d415
commit f30c3869b6
4 files changed
+119 -65

No files matched your search

@@ -5,7 +5,10 @@ import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlOptions;
/**
* DB2 platform specific DDL.
* SQLite platform specific DDL.
*
* Note: SQLite has very limited alter capabilities. Altering a column is not
* supported and may need a recreation of the whole table
*/
public class SQLiteDdl extends PlatformDdl {
@@ -27,7 +30,47 @@ public class SQLiteDdl extends PlatformDdl {
@Override
public String alterTableAddForeignKey(DdlOptions options, WriteForeignKey request) {
// not supported
return null;
return "-- not supported: " + super.alterTableAddForeignKey(options, request);
}
@Override
public String alterTableDropForeignKey(String tableName, String fkName) {
return "-- not supported: " + super.alterTableDropForeignKey(tableName, fkName);
}
@Override
public String alterTableAddCheckConstraint(String tableName, String checkConstraintName, String checkConstraint) {
return "-- not supported: " + super.alterTableAddCheckConstraint(tableName, checkConstraintName, checkConstraint);
}
@Override
public String alterTableDropConstraint(String tableName, String constraintName) {
return "-- not supported: " + super.alterTableDropConstraint(tableName, constraintName);
}
@Override
public String alterTableAddUniqueConstraint(String tableName, String uqName, String[] columns, String[] nullableColumns) {
return "-- not supported: " + super.alterTableAddUniqueConstraint(tableName, uqName, columns, nullableColumns);
}
@Override
public String alterTableDropUniqueConstraint(String tableName, String uniqueConstraintName) {
return "-- not supported: " + super.alterTableDropUniqueConstraint(tableName, uniqueConstraintName);
}
@Override
public String alterColumnDefaultValue(String tableName, String columnName, String defaultValue) {
return "-- not supported: " + super.alterColumnDefaultValue(tableName, columnName, defaultValue);
}
@Override
public String alterColumnType(String tableName, String columnName, String type) {
return "-- not supported: " + super.alterColumnType(tableName, columnName, type);
}
@Override
public String alterColumnNotnull(String tableName, String columnName, boolean notnull) {
return "-- not supported: " + super.alterColumnNotnull(tableName, columnName, notnull);
}
}