create primary keys on directly on table creation instead of a seperate operation
This commit is contained in:
@@ -102,7 +102,10 @@ public class MysqlMigrationOperationTranslator implements MigrationOperationTran
|
||||
var f = e.build();
|
||||
return "`" + f.getField() + "` " + f.getSqlType() + (f.isNotNull() ? " NOT NULL" : "");
|
||||
}).collect(Collectors.joining(", "))
|
||||
+ ")"); //TODO default collocation from database config or operation, field collation, primary key, constraints
|
||||
+ (op.getPrimaryKey() != null
|
||||
? ", PRIMARY KEY (" + op.getPrimaryKey().build().getFields().stream().map(e -> "`" + e + "`").collect(Collectors.joining(", ")) + ")"
|
||||
: "")
|
||||
+ ")"); //TODO default collocation from database config or operation, field collation, constraints
|
||||
}
|
||||
|
||||
private static PreparedStatement translateAddUniqueKeyOperation(Connection connection, MigrationOperation operation) throws SQLException {
|
||||
|
||||
Reference in New Issue
Block a user