mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Fix dbmigration (#1277)
ENH: Support adding a '-- Generated by' comment to DDL including version and timestamp
This commit is contained in:
committed by
Rob Bygrave
parent
0e219a9bc6
commit
91cb5a23fd
@@ -45,14 +45,14 @@ public class PlatformDdlWriter {
|
||||
public void processMigration(Migration dbMigration, DdlWrite write, File writePath, String fullVersion) throws IOException {
|
||||
|
||||
DdlHandler handler = handler();
|
||||
|
||||
handler.generateProlog(write);
|
||||
List<ChangeSet> changeSets = dbMigration.getChangeSet();
|
||||
for (ChangeSet changeSet : changeSets) {
|
||||
if (isApply(changeSet)) {
|
||||
handler.generate(write, changeSet);
|
||||
}
|
||||
}
|
||||
handler.generateExtra(write);
|
||||
handler.generateEpilog(write);
|
||||
|
||||
writePlatformDdl(write, writePath, fullVersion);
|
||||
}
|
||||
@@ -88,6 +88,10 @@ public class PlatformDdlWriter {
|
||||
*/
|
||||
protected void writeApplyDdl(Writer writer, DdlWrite write) throws IOException {
|
||||
|
||||
String header = config.getDdlHeader();
|
||||
if (header != null) {
|
||||
writer.append(header).append('\n');
|
||||
}
|
||||
// merge the apply buffers in the appropriate order
|
||||
prependDropDependencies(writer, write.applyDropDependencies());
|
||||
writer.append("-- apply changes\n");
|
||||
|
||||
Reference in New Issue
Block a user