Git Product home page Git Product logo

apgdiff's People

Contributors

atilacamurca avatar avbasov avatar awful-b avatar brunomgalmeida avatar darktyger avatar dwatson78 avatar fordfrog avatar ibrabeicker avatar intgr avatar jalissonmello avatar jeremp avatar jonnio avatar lben avatar mjr6140 avatar mkonecny avatar new-innov avatar pypt avatar ruslantalpa avatar sebth avatar serge-pouliquen-itf avatar steve-chavez avatar valoricde avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

apgdiff's Issues

wrong --version output

This is really a minor issue, but

$ java -jar ./apgdiff-2.6.6-subzero.jar --version
Version: 2.6.2-subzero

I just noticed but it was the same in an earlier release:

$ java -jar ./apgdiff-2.6.4-subzero.jar --version
Version: 2.6.2-subzero

Support Postgres 10 sequences

fordfrog/apgdiff does not support Postgres 10 sequences. Running apgdiff where there are Postgres 10 sequences will produce an exception similar to the following: cz.startnet.utils.pgdiff.parsers.ParserException: Cannot parse string: CREATE SEQUENCE. This is issue #225 on fordfrog/apgdiff and pull request #228 has a fix, but is waiting to be merged.

It would be useful to me if the subzero apgdiff fork had that fix.

(Thanks for all your help!)

Sequence related errors

When following the API Core and creating a single migration from all the changes there I got these SEQUENCE errors:

  • Getting GRANT TABLE instead of GRANT SEQUENCE:
-- Incorrect
REVOKE ALL ON TABLE client_id_seq FROM webuser;
GRANT USAGE ON TABLE client_id_seq TO webuser;
-- Correct
REVOKE ALL ON SEQUENCE client_id_seq FROM webuser;
GRANT USAGE ON SEQUENCE client_id_seq TO webuser;

See the manual change necessary to fix the migration here.

  • Getting CREATE TABLE's with inline DEFAULT nextval, before CREATE SEQUENCE.
CREATE TABLE client (
  id integer DEFAULT nextval('client_id_seq'::regclass) NOT NULL
  ..
ERROR:  relation "data.clients_id_seq" does not exist

The reordering needed to fix this issue is not that simple, one needs to move the CREATE SEQUENCE before the table declarations and the ALTER SEQUENCE OWNED BY must be moved after, manual fix in the migration here.

Though with apgdiff the reordering of statements sometimes needs to happen, this last reorder could be avoided altogether by changing the apgdiff DEFAULT nextval inline style to an explicit ALTER like the way pg_dump does:

ALTER TABLE ONLY client ALTER COLUMN id SET DEFAULT nextval('client_id_seq'::regclass);

The change in the migration with this style is like this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.