Package liquibase.structure.core

Examples of liquibase.structure.core.Column$AutoIncrementInformation


    @Override
    public void checkDiffResult(DiffResult diffResult, AddPrimaryKeyChange change) {
        String[] columnNames = change.getColumnNames().split(",");
        Column[] columns = new Column[columnNames.length];
        for (int i=0; i<columnNames.length; i++) {
            columns[i] = new Column(columnNames[i]);
        }
        PrimaryKey pk = diffResult.getUnexpectedObject(new PrimaryKey(change.getConstraintName(), change.getCatalogName(), change.getSchemaName(), change.getTableName(), columns));
        assertNotNull(pk);
    }
View Full Code Here


        return new Change[] {createTableChange };
    }

    @Override
    public void checkDiffResult(DiffResult diffResult, MergeColumnChange change) {
        assertNotNull(diffResult.getMissingObject(new Column(Table.class, change.getCatalogName(), change.getSchemaName(), change.getTableName(), change.getColumn1Name())));
        assertNotNull(diffResult.getMissingObject(new Column(Table.class, change.getCatalogName(), change.getSchemaName(), change.getTableName(), change.getColumn2Name())));

        assertNotNull(diffResult.getUnexpectedObject(new Column(Table.class, change.getCatalogName(), change.getSchemaName(), change.getTableName(), change.getFinalColumnName())));

    }
View Full Code Here

        assertNotNull(newTable.getColumn(change.getNewColumnName()));
//todo        assertEquals(change.getNewColumnDataType(), newTable.getColumn(change.getNewColumnName()).getType().toString());
        assertEquals(change.getNewColumnName().toUpperCase(), newTable.getPrimaryKey().getColumnNames().toUpperCase());

        assertNotNull(diffResult.getUnexpectedObject(new Table(change.getNewTableCatalogName(), change.getNewTableSchemaName(), change.getNewTableName())));
        assertNotNull(new ForeignKey(change.getConstraintName(), change.getExistingTableCatalogName(), change.getExistingTableSchemaName(), change.getExistingTableName(), new Column(change.getExistingColumnName())));

    }
View Full Code Here

        return new Change[] {createTableChange };
    }

    @Override
    public void checkDiffResult(DiffResult diffResult, DropNotNullConstraintChange change) {
        ObjectDifferences diff = diffResult.getChangedObject(new Column(Table.class, change.getCatalogName(), change.getSchemaName(), change.getTableName(), change.getColumnName()));
        assertFalse((Boolean) diff.getDifference("nullable").getReferenceValue());
        assertTrue((Boolean) diff.getDifference("nullable").getComparedValue());
    }
View Full Code Here

    }

    @Override
    public void checkDiffResult(DiffResult diffResult, ModifyDataTypeChange change) {
        ObjectDifferences colDiff = diffResult.getChangedObject(new Column(Table.class, change.getCatalogName(), change.getSchemaName(), change.getTableName(), change.getColumnName()));
        assertNotNull(colDiff);
        assertNotNull(colDiff.getDifference("type"));
//todo        assertEquals(change.getNewDataType(), colDiff.getDifference("type").getComparedValue().toString());
    }
View Full Code Here

        return new Change[] {createTableChange };
    }

    @Override
    public void checkDiffResult(DiffResult diffResult, DropColumnChange change) {
        assertNotNull(diffResult.getMissingObject(new Column(Table.class, change.getCatalogName(), change.getSchemaName(), change.getTableName(), change.getColumnName())));
    }
View Full Code Here

    }

    @Override
    public ChangeStatus checkStatus(Database database) {
        try {
            return new ChangeStatus().assertComplete(!SnapshotGeneratorFactory.getInstance().has(new Column(Table.class, getCatalogName(), getSchemaName(), getTableName(), getColumnName()), database), "Column exists");
        } catch (Exception e) {
            return new ChangeStatus().unknown(e);
        }

    }
View Full Code Here

    public void checkDiffResult(DiffResult diffResult, DropUniqueConstraintChange change) {
        Column[] columns = null;
        if (change.getUniqueColumns() != null) {
            String[] columnNames = change.getUniqueColumns().split(",");
            for (int i=0; i<columnNames.length; i++) {
                columns[i] = new Column(columnNames[i]);
            }
        }

        assertNotNull(diffResult.getMissingObject(new UniqueConstraint(change.getConstraintName(), change.getCatalogName(), change.getSchemaName(), change.getTableName(), columns)));
    }
View Full Code Here

    @Override
    public ChangeStatus checkStatus(Database database) {
        try {
            ChangeStatus changeStatus = new ChangeStatus();
            Column newColumn = SnapshotGeneratorFactory.getInstance().createSnapshot(new Column(Table.class, getCatalogName(), getSchemaName(), getTableName(), getNewColumnName()), database);
            Column oldColumn = SnapshotGeneratorFactory.getInstance().createSnapshot(new Column(Table.class, getCatalogName(), getSchemaName(), getTableName(), getOldColumnName()), database);

            if (newColumn == null && oldColumn == null) {
                return changeStatus.unknown("Neither column exists");
            }
            if (newColumn != null && oldColumn != null) {
View Full Code Here

      }
      @Override
            public boolean createThisIndex(Index index) {
        if (index.getColumns().contains(getOldColumnName())) {
          index.getColumns().remove(getOldColumnName());
          index.addColumn(new Column(getNewColumnName()).setRelation(index.getTable()));
        }
        return true;
      }
    };
       
View Full Code Here

TOP

Related Classes of liquibase.structure.core.Column$AutoIncrementInformation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.