fordfrog / apgdiff

Another PostgreSQL Diff Tool
http://www.apgdiff.com
MIT License
355 stars 138 forks source link

Cannot parse string: CREATE TABLE #243

Open ianthrive opened 6 years ago

ianthrive commented 6 years ago

apgdiff 2.4 jdk 10.0.2

Exception in thread "main" cz.startnet.utils.pgdiff.parsers.ParserException: Cannot parse string: CREATE TABLE public.timeclock_punches (
    id integer NOT NULL,
    user_id integer NOT NULL,
    type_id text NOT NULL,
    class_id text DEFAULT 'worked'::text NOT NULL,
    startend tstzrange DEFAULT tstzrange(now(), NULL::timestamp with time zone, '[)'::text) NOT NULL,
    created_date timestamp with time zone DEFAULT now() NOT NULL,
    updated_date timestamp with time zone DEFAULT now() NOT NULL,
    created_id integer,
    updated_id integer,
    error boolean DEFAULT false NOT NULL,
    location_start text,
    location_end text,
    department_id integer,
    CONSTRAINT timeclock_punches_location_end_check CHECK ((location_end <> ''::text)),
    CONSTRAINT timeclock_punches_location_start_check CHECK ((location_start <> ''::text)),
    CONSTRAINT timeclock_punches_startend_check CHECK (((lower_inc(startend) IS TRUE) AND (upper_inc(startend) IS FALSE) AND (upper(startend) >= lower(startend)) AND ((lower(startend) - upper(startend)) < '24:00:00'::interval)))
);
Unsupported command at position 266 'NOT NULL,
    create'
    at cz.startnet.utils.pgdiff.parsers.Parser.throwUnsupportedCommand(Parser.java:390)
    at cz.startnet.utils.pgdiff.parsers.CreateTableParser.parse(CreateTableParser.java:84)
    at cz.startnet.utils.pgdiff.loader.PgDumpLoader.loadDatabaseSchema(PgDumpLoader.java:178)
    at cz.startnet.utils.pgdiff.loader.PgDumpLoader.loadDatabaseSchema(PgDumpLoader.java:236)
    at cz.startnet.utils.pgdiff.PgDiff.createDiff(PgDiff.java:29)
    at cz.startnet.utils.pgdiff.Main.main(Main.java:39)
jalissonmello commented 5 years ago

Test with this jar https://github.com/fordfrog/apgdiff/issues/239#issuecomment-414983656

jalissonmello commented 5 years ago

Now in release the folder its the jar version 2.6.0

jalissonmello commented 5 years ago

Can you provide the script or a example to help with the tests?