Package liquibase.change.core

Examples of liquibase.change.core.CreateProcedureChange


        public Set<InputStream> getResourcesAsStream(String path) throws IOException {
            InputStream stream = null;
            if (path.toLowerCase().endsWith("csv")) {
                stream = new ByteArrayInputStream(usersCsv.getBytes());
            } else if (path.toLowerCase().endsWith("my-logic.sql")) {
                stream = new ByteArrayInputStream(((String)ChangeFactory.getInstance().getChangeMetaData(new CreateProcedureChange()).getParameters().get("procedureBody").getExampleValue(new HsqlDatabase())).getBytes());
            } else if (path.toLowerCase().endsWith("sql")) {
                stream =new ByteArrayInputStream(fileSql.getBytes());
            } else {
                throw new RuntimeException("Unknown resource type: "+ path);
            }
View Full Code Here


        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());
        createProcedureChange.setProcedureText("CREATE PROCEDURE new_customer(firstname VARCHAR(50), lastname VARCHAR(50))\n" +
                "   MODIFIES SQL DATA\n" +
                "   INSERT INTO CUSTOMERS (first_name, last_name) VALUES (firstname, lastname)");

        return new Change[] {
                createTableChange,
View Full Code Here

TOP

Related Classes of liquibase.change.core.CreateProcedureChange

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.