Examples of PgIndex


Examples of cz.startnet.utils.pgdiff.schema.PgIndex

            throw new RuntimeException(MessageFormat.format(
                    Resources.getString("CannotFindTable"), tableName,
                    statement));
        }

        final PgIndex index = new PgIndex(indexName);
        table.addIndex(index);
        schema.addIndex(index);
        index.setDefinition(definition.trim());
        index.setTableName(table.getName());
        index.setUnique(unique);
    }
View Full Code Here

Examples of cz.startnet.utils.pgdiff.schema.PgIndex

        final String objectName = ParserUtils.getObjectName(indexName);
        final String schemaName =
                ParserUtils.getSchemaName(indexName, database);
        final PgSchema schema = database.getSchema(schemaName);

        final PgIndex index = schema.getIndex(objectName);

        if (index == null) {
            final PgConstraint primaryKey = schema.getPrimaryKey(objectName);
            parser.expect("IS");
            primaryKey.setComment(getComment(parser));
            parser.expect(";");
        } else {
            parser.expect("IS");
            index.setComment(getComment(parser));
            parser.expect(";");
        }
    }
View Full Code Here

Examples of cz.startnet.utils.pgdiff.schema.PgIndex

        if (oldSchema == null) {
            return;
        }

        for (final PgIndex oldIndex : oldSchema.getIndexes()) {
            final PgIndex newIndex = newSchema.getIndex(oldIndex.getName());

            if (newIndex == null) {
                continue;
            }

            if (oldIndex.getComment() == null
                    && newIndex.getComment() != null
                    || oldIndex.getComment() != null
                    && newIndex.getComment() != null
                    && !oldIndex.getComment().equals(
                    newIndex.getComment())) {
                searchPathHelper.outputSearchPath(writer);
                writer.println();
                writer.print("COMMENT ON INDEX ");
                writer.print(
                        PgDiffUtils.getQuotedName(newIndex.getName()));
                writer.print(" IS ");
                writer.print(newIndex.getComment());
                writer.println(';');
            } else if (oldIndex.getComment() != null
                    && newIndex.getComment() == null) {
                searchPathHelper.outputSearchPath(writer);
                writer.println();
                writer.print("COMMENT ON INDEX ");
                writer.print(
                        PgDiffUtils.getQuotedName(newIndex.getName()));
                writer.println(" IS NULL;");
            }
        }
    }
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.