subzerocloud / apgdiff Goto Github PK
View Code? Open in Web Editor NEWThis project forked from fordfrog/apgdiff
Another PostgreSQL Diff Tool
Home Page: http://www.apgdiff.com
License: MIT License
This project forked from fordfrog/apgdiff
Another PostgreSQL Diff Tool
Home Page: http://www.apgdiff.com
License: MIT License
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
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!)
Here it is for the table
https://github.com/fordfrog/apgdiff/blob/caaaed9d6189f4ee6319c119137c2c701f76ecd8/src/main/java/cz/startnet/utils/pgdiff/PgDiffTables.java#L545-L549
the view needs to have the same behaviour
When following the API Core and creating a single migration from all the changes there I got these SEQUENCE errors:
-- 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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.