ForestAdmin / lumber

Install Forest Admin in minutes.
https://www.forestadmin.com
MIT License
2.08k stars 106 forks source link

[*] Command Generate - Remove extraneous calls to Sequelize.literal in generated models #410

Closed guillaumedeslandes closed 4 years ago

guillaumedeslandes commented 4 years ago

Generated model files used Sequelize.literal for all default value. This is not necessary (as per ForestAdmin doc and lead to simple values being displayed as [object Object] in ForestAdmin create forms.

Goes with https://github.com/ForestAdmin/forest-express-sequelize/pull/389

rap2hpoutre commented 4 years ago

On other hand, I tested with this table and it works like a charm! 👌 Good job! 🎉

create table tabl
(
    id serial not null
        constraint tabl_pk
            primary key,
    des varchar,
    q integer[] default '{1,2,3}'::integer[],
    column_4 integer default 123,
    column_5 varchar default 'fdfd'::character varying,
    column_6 date default now(),
    price numeric default 9.99,
    updt date default now(),
    column_9 jsonb default '[{"a": "b"}]'::jsonb
);

alter table tabl owner to forest;