Package liquibase.change.core

Examples of liquibase.change.core.CreateTableChange.addColumn()


        CreateTableChange createTableChange = new CreateTableChange();
        createTableChange.setCatalogName(change.getCatalogName());
        createTableChange.setSchemaName(change.getSchemaName());
        createTableChange.setTableName("person");
        createTableChange.addColumn(new ColumnConfig().setName("id").setType("int"));
        createTableChange.addColumn(new ColumnConfig().setName("name").setType("varchar(20)"));

        CreateViewChange createViewChange = new CreateViewChange();
        createViewChange.setCatalogName(change.getCatalogName());
        createViewChange.setSchemaName(change.getSchemaName());
        createViewChange.setViewName(change.getViewName());
View Full Code Here


    public Change[]  prepareDatabase(MergeColumnChange change) throws DatabaseException {
        CreateTableChange createTableChange = new CreateTableChange();
        createTableChange.setCatalogName(change.getCatalogName());
        createTableChange.setSchemaName(change.getSchemaName());
        createTableChange.setTableName(change.getTableName());
        createTableChange.addColumn(new ColumnConfig().setName(change.getColumn1Name()).setType("varchar(10)"));
        createTableChange.addColumn(new ColumnConfig().setName(change.getColumn2Name()).setType("varchar(10)"));

        return new Change[] {createTableChange };
    }
View Full Code Here

        CreateTableChange createTableChange = new CreateTableChange();
        createTableChange.setCatalogName(change.getCatalogName());
        createTableChange.setSchemaName(change.getSchemaName());
        createTableChange.setTableName(change.getTableName());
        createTableChange.addColumn(new ColumnConfig().setName(change.getColumn1Name()).setType("varchar(10)"));
        createTableChange.addColumn(new ColumnConfig().setName(change.getColumn2Name()).setType("varchar(10)"));

        return new Change[] {createTableChange };
    }

    @Override
View Full Code Here

        CreateTableChange createTableChange= new CreateTableChange();
        createTableChange.setCatalogName(change.getExistingTableCatalogName());
        createTableChange.setSchemaName(change.getExistingTableSchemaName());
        createTableChange.setTableName(change.getExistingTableName());

        createTableChange.addColumn(new ColumnConfig().setName("other_column").setType("int"));
        createTableChange.addColumn(new ColumnConfig().setName(change.getExistingColumnName()).setType(change.getNewColumnDataType()));

        return new Change[] {createTableChange };
    }
View Full Code Here

        createTableChange.setCatalogName(change.getExistingTableCatalogName());
        createTableChange.setSchemaName(change.getExistingTableSchemaName());
        createTableChange.setTableName(change.getExistingTableName());

        createTableChange.addColumn(new ColumnConfig().setName("other_column").setType("int"));
        createTableChange.addColumn(new ColumnConfig().setName(change.getExistingColumnName()).setType(change.getNewColumnDataType()));

        return new Change[] {createTableChange };
    }

    @Override
View Full Code Here

    public Change[]  prepareDatabase(DropProcedureChange change) throws DatabaseException {
        CreateTableChange createTableChange = new CreateTableChange();
        createTableChange.setCatalogName(change.getCatalogName());
        createTableChange.setSchemaName(change.getSchemaName());
        createTableChange.setTableName("customers");
        createTableChange.addColumn(new ColumnConfig().setName("id").setType("int").setConstraints(new ConstraintsConfig().setNullable(false).setPrimaryKey(true)).setAutoIncrement(true));
        createTableChange.addColumn(new ColumnConfig().setName("first_name").setType("varchar(50)"));
        createTableChange.addColumn(new ColumnConfig().setName("last_name").setType("varchar(50)"));

        CreateProcedureChange createProcedureChange = new CreateProcedureChange();
        createProcedureChange.setCatalogName(change.getCatalogName());
View Full Code Here

        CreateTableChange createTableChange = new CreateTableChange();
        createTableChange.setCatalogName(change.getCatalogName());
        createTableChange.setSchemaName(change.getSchemaName());
        createTableChange.setTableName("customers");
        createTableChange.addColumn(new ColumnConfig().setName("id").setType("int").setConstraints(new ConstraintsConfig().setNullable(false).setPrimaryKey(true)).setAutoIncrement(true));
        createTableChange.addColumn(new ColumnConfig().setName("first_name").setType("varchar(50)"));
        createTableChange.addColumn(new ColumnConfig().setName("last_name").setType("varchar(50)"));

        CreateProcedureChange createProcedureChange = new CreateProcedureChange();
        createProcedureChange.setCatalogName(change.getCatalogName());
        createProcedureChange.setSchemaName(change.getSchemaName());
View Full Code Here

        createTableChange.setCatalogName(change.getCatalogName());
        createTableChange.setSchemaName(change.getSchemaName());
        createTableChange.setTableName("customers");
        createTableChange.addColumn(new ColumnConfig().setName("id").setType("int").setConstraints(new ConstraintsConfig().setNullable(false).setPrimaryKey(true)).setAutoIncrement(true));
        createTableChange.addColumn(new ColumnConfig().setName("first_name").setType("varchar(50)"));
        createTableChange.addColumn(new ColumnConfig().setName("last_name").setType("varchar(50)"));

        CreateProcedureChange createProcedureChange = new CreateProcedureChange();
        createProcedureChange.setCatalogName(change.getCatalogName());
        createProcedureChange.setSchemaName(change.getSchemaName());
        createProcedureChange.setProcedureName(change.getProcedureName());
View Full Code Here

        createTableChange.setCatalogName(change.getCatalogName());
        createTableChange.setSchemaName(change.getSchemaName());
        createTableChange.setTableName(change.getTableName());

        for (String column : change.getColumnNames().split(",")) {
            createTableChange.addColumn(new ColumnConfig().setName(column.trim()).setType("int").setConstraints(new ConstraintsConfig().setNullable(false)));
        }
        createTableChange.addColumn(new ColumnConfig().setName("other_column").setType("int"));

        return new Change[] {createTableChange };
View Full Code Here

        createTableChange.setTableName(change.getTableName());

        for (String column : change.getColumnNames().split(",")) {
            createTableChange.addColumn(new ColumnConfig().setName(column.trim()).setType("int").setConstraints(new ConstraintsConfig().setNullable(false)));
        }
        createTableChange.addColumn(new ColumnConfig().setName("other_column").setType("int"));

        return new Change[] {createTableChange };

    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.