Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solve issue #61, respect the original order of the columns at the time the table is created #73

Closed
wants to merge 1 commit into from

Conversation

rafaelsagastume
Copy link
Contributor

@rafaelsagastume rafaelsagastume commented Oct 8, 2019

Good afternoon, Euler @eulerto

A pleasure to greet you again, a pull request has been created that solves the order of the columns of a source table when it will be created in target table, the columns are sorted by pg_attribute with the attnum field, solve issue #61.

source table

CREATE TABLE auth.menu
(
id integer NOT NULL DEFAULT nextval('auth.menu_id_seq'::regclass),
id_role integer NOT NULL,
name character varying(100) NOT NULL,
route character varying(50) NOT NULL,
icon character varying(50) NOT NULL,
sort integer NOT NULL,
description character varying(255) NOT NULL,
is_active boolean NOT NULL DEFAULT true,
id_previous integer
)

target table

CREATE TABLE auth.menu (
id integer DEFAULT nextval('auth.menu_id_seq'::regclass) NOT NULL,
id_role integer NOT NULL,
name character varying(100) NOT NULL,
route character varying(50) NOT NULL,
icon character varying(50) NOT NULL,
sort integer NOT NULL,
description character varying(255) NOT NULL,
is_active boolean DEFAULT true NOT NULL,
id_previous integer
);

As I always hope you like the solution, I am open to any feedback

@eulerto
Copy link
Owner

eulerto commented Oct 9, 2019

@rafaelsagastume did you check my comment in issue #61 ? pgquarrel needs to preserve columns order by name because it use it to compare columns. There should be a mechanism to order PQLAttribute by attnum or name then it is easy to print columns using attnum order.

@rafaelsagastume
Copy link
Contributor Author

rafaelsagastume commented Oct 9, 2019

@rafaelsagastume did you check my comment in issue #61 ? pgquarrel needs to preserve columns order by name because it use it to compare columns. There should be a mechanism to order PQLAttribute by attnum or name then it is easy to print columns using attnum order.

@eulerto , Now I realize, what I understand is to do the sorting after processing all the comparisons a moment before generating the sql script, I don't know if I get the correct message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants