Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/jalissonmello/apgdiff in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
jalisson committed May 10, 2020
2 parents f20b29d + 6e69e25 commit a5a412b
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ build
.classpath
.project
dist
.idea/
*.iml
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,27 @@ file it at https://github.com/fordfrog/apgdiff/issues. If you for some reason
need to contact author of this application, you can email him at
[email protected].

This repo is mainly unmaintained. But if you found a bug and create a pull request chances are good that it will be merged.

## Changelog

### Version 2.5 (not released yet)
### Version 2.6

#### New Features
* PostgresSQL 10 Support
* Update dependencies to development with Java 11
* Add security barrier and another options to Views
* Add support to Create/Drop Rule
* Triggers: Rerencing,Enable,Disable
* use using column::type to cast the type of column

#### Fixes
* Fix GRANT SEQUENCE, ALTER VIEW OWNER, GRANT(cols) errors

#### Tasks Done
* Remove SourceForge repository

### Version 2.5

#### New Features
* MATERIALIZED VIEW support in PostgreSQL 9.3 (Marti Raudsepp)
Expand Down Expand Up @@ -40,6 +58,8 @@ [email protected].
* Fixed issue with the $ sign in the object name (Anatoliy Basov)
* Added French translation. (Jeremy Passeron)
* Native for OS line endings in resulting diff (Sergej Bonich)
* Add support for new Postgres schema dump format
* Support for Postgres 10 CREATE SEQUENCE data type

### 2012-09-21: Version 2.4

Expand Down
Binary file added releases/apgdiff-2.6.0.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public PgConstraint(String name) {
public String getCreationSQL() {
final StringBuilder sbSQL = new StringBuilder(100);
sbSQL.append("ALTER TABLE ");
sbSQL.append(PgDiffUtils.getDropIfExists());
sbSQL.append(PgDiffUtils.getQuotedName(getTableName()));
sbSQL.append(System.getProperty("line.separator"));
sbSQL.append("\tADD CONSTRAINT ");
Expand Down Expand Up @@ -120,6 +121,7 @@ public String getDefinition() {
public String getDropSQL() {
final StringBuilder sbSQL = new StringBuilder(100);
sbSQL.append("ALTER TABLE ");
sbSQL.append(PgDiffUtils.getDropIfExists());
sbSQL.append(PgDiffUtils.getQuotedName(getTableName()));
sbSQL.append(System.getProperty("line.separator"));
sbSQL.append("\tDROP CONSTRAINT ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
*/
package cz.startnet.utils.pgdiff.loader;

import java.util.Arrays;
import java.util.Collection;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import java.util.Arrays;
import java.util.Collection;

/**
* Tests for PgDiffLoader class.
*
Expand Down Expand Up @@ -44,7 +45,8 @@ public static Collection<?> parameters() {
{13},
{14},
{15},
{16}
{16},
{18}
});
}
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
ALTER TABLE agent
ADD COLUMN IF NOT EXISTS abc BIGINT;

COMMENT ON COLUMN agent.id IS 'This ID support schema name';

COMMENT ON COLUMN agent.abc IS 'This agent supports credit system or not.';
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ CREATE TABLE public."agent"(
id BIGINT,
abc BIGINT
);
COMMENT ON COLUMN "agent"."abc" IS 'This agent supports credit system or not.';
COMMENT ON COLUMN "agent"."abc" IS 'This agent supports credit system or not.';
COMMENT ON COLUMN "public"."agent"."id" IS 'This ID support schema name';
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

ALTER TABLE testtable
ALTER TABLE IF EXISTS testtable
ADD CONSTRAINT IF NOT EXISTS field4check CHECK (((field4 > (-5.0)::double precision) AND (field4 < (5.0)::double precision)));
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ CREATE TABLE IF NOT EXISTS "procedureresult$Operation" (

ALTER TABLE "procedureresult$Operation" OWNER TO fordfrog;

ALTER TABLE "procedureresult$Operation"
ALTER TABLE IF EXISTS "procedureresult$Operation"
ADD CONSTRAINT IF NOT EXISTS $1 FOREIGN KEY (result_id) REFERENCES testtable(field1) ON UPDATE RESTRICT ON DELETE RESTRICT;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

ALTER TABLE inventoryitemsupplier
ALTER TABLE IF EXISTS inventoryitemsupplier
ADD CONSTRAINT IF NOT EXISTS inventoryitemsupplier_pkey PRIMARY KEY (id);

ALTER TABLE inventoryitemsupplier
ALTER TABLE IF EXISTS inventoryitemsupplier
ADD CONSTRAINT IF NOT EXISTS inventoryitemsupplier_5a808b9c_key UNIQUE (inventoryitemid, partneridentificationid);
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

ALTER TABLE testtable
ALTER TABLE IF EXISTS testtable
DROP CONSTRAINT IF EXISTS field4check;
39 changes: 39 additions & 0 deletions src/test/resources/cz/startnet/utils/pgdiff/loader/schema_18.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
--
-- PostgreSQL database dump
--

-- Dumped from database version 9.5.13
-- Dumped by pg_dump version 9.5.13

SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;

CREATE TABLE public.locations (
id uuid NOT NULL,
square_feet integer DEFAULT 0 NOT NULL,
name character varying(50),
description character varying(255),
site_id uuid NOT NULL,
default_yearly_hours integer,
epact_code_name character varying,
savings_percent double precision,
ceiling_height integer DEFAULT 0 NOT NULL,
map_number integer,
project_id uuid,
notes character varying,
existing_controls boolean DEFAULT false NOT NULL,
fixture_height integer DEFAULT 0 NOT NULL,
luminescence character varying(255)
);

--
-- Name: COLUMN locations.default_yearly_hours; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.locations.default_yearly_hours IS 'Informs audit items on what their default yearly hours should be';
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

ALTER TABLE testtable
ALTER TABLE IF EXISTS testtable
DROP CONSTRAINT IF EXISTS field4check;

ALTER TABLE testtable
ALTER TABLE IF EXISTS testtable
ADD CONSTRAINT IF NOT EXISTS field4check CHECK ((field4 > (0.0)::double precision));

0 comments on commit a5a412b

Please sign in to comment.