mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-12 22:41:35 +00:00
#2403 - table partitioning (Postgres only at this point) is always included + simplify skip logic
This commit is contained in:
1 parent
4f70c09690
commit
0139ad891e
2 files changed
+5
-8
No files matched your search
@@ -212,7 +212,7 @@ public class DdlGenerator implements SpiDdlGenerator {
|
|||||||
if (extraDdl && jaxbPresent) {
|
if (extraDdl && jaxbPresent) {
|
||||||
if (currentModel().isTablePartitioning()) {
|
if (currentModel().isTablePartitioning()) {
|
||||||
String extraPartitioning = ExtraDdlXmlReader.buildPartitioning(platform);
|
String extraPartitioning = ExtraDdlXmlReader.buildPartitioning(platform);
|
||||||
if (extraPartitioning != null && !extraPartitioning.isEmpty() && useMigrationStoredProcedures) {
|
if (extraPartitioning != null && !extraPartitioning.isEmpty()) {
|
||||||
runScript(connection, false, extraPartitioning, "builtin-partitioning-ddl");
|
runScript(connection, false, extraPartitioning, "builtin-partitioning-ddl");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-7
@@ -397,23 +397,20 @@ public class DefaultDbMigration implements DbMigration {
|
|||||||
private void generateExtraDdl(File migrationDir, DatabasePlatform dbPlatform, boolean tablePartitioning) throws IOException {
|
private void generateExtraDdl(File migrationDir, DatabasePlatform dbPlatform, boolean tablePartitioning) throws IOException {
|
||||||
if (dbPlatform != null) {
|
if (dbPlatform != null) {
|
||||||
if (tablePartitioning && includeBuiltInPartitioning) {
|
if (tablePartitioning && includeBuiltInPartitioning) {
|
||||||
generateExtraDdlFor(migrationDir, dbPlatform, ExtraDdlXmlReader.readBuiltinTablePartitioning(), true);
|
generateExtraDdlFor(migrationDir, dbPlatform, ExtraDdlXmlReader.readBuiltinTablePartitioning(), false);
|
||||||
}
|
}
|
||||||
|
// skip built-in migration stored procedures based on isUseMigrationStoredProcedures
|
||||||
generateExtraDdlFor(migrationDir, dbPlatform, ExtraDdlXmlReader.readBuiltin(), true);
|
generateExtraDdlFor(migrationDir, dbPlatform, ExtraDdlXmlReader.readBuiltin(), true);
|
||||||
generateExtraDdlFor(migrationDir, dbPlatform, ExtraDdlXmlReader.read(), false);
|
generateExtraDdlFor(migrationDir, dbPlatform, ExtraDdlXmlReader.read(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateExtraDdlFor(File migrationDir, DatabasePlatform dbPlatform, ExtraDdl extraDdl, boolean isBuiltin) throws IOException {
|
private void generateExtraDdlFor(File migrationDir, DatabasePlatform dbPlatform, ExtraDdl extraDdl, boolean checkSkip) throws IOException {
|
||||||
if (extraDdl != null) {
|
if (extraDdl != null) {
|
||||||
List<DdlScript> ddlScript = extraDdl.getDdlScript();
|
List<DdlScript> ddlScript = extraDdl.getDdlScript();
|
||||||
for (DdlScript script : ddlScript) {
|
for (DdlScript script : ddlScript) {
|
||||||
if (!script.isDrop() && matchPlatform(dbPlatform.getPlatform(), script.getPlatforms())) {
|
if (!script.isDrop() && matchPlatform(dbPlatform.getPlatform(), script.getPlatforms())) {
|
||||||
if (script.isInit()) {
|
if (!checkSkip || dbPlatform.isUseMigrationStoredProcedures()) {
|
||||||
if (!isBuiltin || dbPlatform.isUseMigrationStoredProcedures()) {
|
|
||||||
writeExtraDdl(migrationDir, script);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
writeExtraDdl(migrationDir, script);
|
writeExtraDdl(migrationDir, script);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user