Search in sources :

Example 1 with DfSchemaXmlSerializer

use of org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlSerializer in project dbflute-core by dbflute.

the class DfAlterCheckProcess method createSchemaXmlSerializer.

protected DfSchemaXmlSerializer createSchemaXmlSerializer(String schemaXml, DfCraftDiffAssertDirection direction) {
    // no use history here (use SchemaDiff directly later)
    final String historyFile = null;
    final DfSchemaXmlSerializer serializer = DfSchemaXmlSerializer.createAsManage(_dataSource, schemaXml, historyFile);
    final String craftMetaDir = getMigrationAlterCheckCraftMetaDir();
    serializer.enableCraftDiff(_dataSource, craftMetaDir, direction);
    return serializer;
}
Also used : DfSchemaXmlSerializer(org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlSerializer)

Example 2 with DfSchemaXmlSerializer

use of org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlSerializer in project dbflute-core by dbflute.

the class TorqueJDBCTransformTask method doExecute.

// ===================================================================================
// Execute
// =======
@Override
protected void doExecute() {
    final DfSchemaXmlSerializer serializer = DfSchemaXmlSerializer.createAsCore(getDataSource());
    serializer.serialize();
}
Also used : DfSchemaXmlSerializer(org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlSerializer)

Example 3 with DfSchemaXmlSerializer

use of org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlSerializer in project dbflute-core by dbflute.

the class DfAlterCheckProcess method serializePreviousSchema.

protected void serializePreviousSchema() {
    final String previousXml = getMigrationAlterCheckPreviousSchemaXml();
    final DfCraftDiffAssertDirection direction = DfCraftDiffAssertDirection.DIRECT_PREVIOUS;
    final DfSchemaXmlSerializer serializer = createSchemaXmlSerializer(previousXml, direction);
    serializer.serialize();
}
Also used : DfSchemaXmlSerializer(org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlSerializer) DfCraftDiffAssertDirection(org.dbflute.logic.doc.craftdiff.DfCraftDiffAssertDirection)

Example 4 with DfSchemaXmlSerializer

use of org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlSerializer in project dbflute-core by dbflute.

the class DfSchemaSyncChecker method checkSync.

// ===================================================================================
// Check Sync
// ==========
public void checkSync() {
    clearOutputResource();
    final DfSchemaXmlSerializer serializer = diffSchema();
    _log.info("");
    _log.info("* * * * * * * * * * * * * * * * *");
    _log.info("*                               *");
    _log.info("*   Check Schema Synchronized   *");
    _log.info("*                               *");
    _log.info("* * * * * * * * * * * * * * * * *");
    final DfSchemaDiff schemaDiff = serializer.getSchemaDiff();
    if (schemaDiff.hasDiff()) {
        _log.info(" -> the schema has differences");
        throwSchemaSyncCheckTragedyResultException();
    } else {
        // synchronized
        _log.info(" -> the schema is synchronized");
        clearOutputResource();
    }
}
Also used : DfSchemaDiff(org.dbflute.logic.jdbc.schemadiff.DfSchemaDiff) DfSchemaXmlSerializer(org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlSerializer)

Example 5 with DfSchemaXmlSerializer

use of org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlSerializer in project dbflute-core by dbflute.

the class DfSchemaSyncChecker method serializeMainSchema.

protected DfSchemaXmlSerializer serializeMainSchema() {
    // as next
    final DfSchemaXmlSerializer mainSerializer = createMainSerializer();
    // because of comparison with other schema
    mainSerializer.suppressSchemaDiff();
    mainSerializer.serialize();
    return mainSerializer;
}
Also used : DfSchemaXmlSerializer(org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlSerializer)

Aggregations

DfSchemaXmlSerializer (org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlSerializer)15 DfCraftDiffAssertDirection (org.dbflute.logic.doc.craftdiff.DfCraftDiffAssertDirection)4 AppData (org.apache.torque.engine.database.model.AppData)3 DfSchemaXmlReader (org.dbflute.logic.jdbc.schemaxml.DfSchemaXmlReader)3 DataSource (javax.sql.DataSource)1 Database (org.apache.torque.engine.database.model.Database)1 DfFittingDataSource (org.dbflute.helper.jdbc.connection.DfFittingDataSource)1 DfSPolicyChecker (org.dbflute.logic.doc.spolicy.DfSPolicyChecker)1 DfSPolicyResult (org.dbflute.logic.doc.spolicy.result.DfSPolicyResult)1 DfSchemaDiff (org.dbflute.logic.jdbc.schemadiff.DfSchemaDiff)1 DfReplaceSchemaProperties (org.dbflute.properties.DfReplaceSchemaProperties)1 DfSchemaPolicyProperties (org.dbflute.properties.DfSchemaPolicyProperties)1