eulerto / pgquarrel

pgquarrel compares PostgreSQL database schemas (DDL)
BSD 3-Clause "New" or "Revised" License
390 stars 42 forks source link

solve issue #61 sort the attributes of the original table (PQLAttribute) #74

Closed rafaelsagastume closed 4 years ago

rafaelsagastume commented 4 years ago

Good afternoon, Euler @eulerto

A pleasure to greet you, the solution that I recommend is to sort the attributes of the PQLAttribute list after pgquarrel compares by name since it is necessary, this process generates the SQL of the dumpCreateTable table with the original order of the attributes to be able to solve the ISSUE #61

source table

CREATE TABLE public.proceso_uno ( id integer NOT NULL DEFAULT nextval('proceso_uno_id_seq'::regclass), nombre_proceso character varying(500) COLLATE pg_catalog."default" NOT NULL DEFAULT 'Ninguno'::character varying, fecha_ingreso timestamp without time zone DEFAULT now(), fecha_proceso date NOT NULL, campo text COLLATE pg_catalog."default", numerico numeric(15,2) NOT NULL DEFAULT 15.2, esta_activo boolean NOT NULL DEFAULT true, id_padre integer, propiedades bigint NOT NULL, direccion character varying(500) COLLATE pg_catalog."default", cantidad integer, precio integer );

target table [sql generated by pgquarrel]

CREATE TABLE public.proceso_uno ( id integer DEFAULT nextval('proceso_uno_id_seq'::regclass) NOT NULL, nombre_proceso character varying(500) DEFAULT 'Ninguno'::character varying NOT NULL, fecha_ingreso timestamp without time zone DEFAULT now(), fecha_proceso date NOT NULL, campo text, numerico numeric(15,2) DEFAULT 15.2 NOT NULL, esta_activo boolean DEFAULT true NOT NULL, id_padre integer, propiedades bigint NOT NULL, direccion character varying(500), cantidad integer, precio integer );

always open to your feedback.