sequelize-auto icon indicating copy to clipboard operation
sequelize-auto copied to clipboard

Text default value not escaped when extracted from custom type

Open paslo22 opened this issue 1 year ago • 0 comments

Hey! We are using this lib to generate ours models and works great! But we found the following issue:

CREATE TYPE test_source AS ENUM ('first', 'second');

CREATE TABLE test
(
    whatever test_source[] DEFAULT '{first}'
);

The model created is:

whatever: {
  type: DataTypes.ARRAY(DataTypes.ENUM("first","second")),
  defaultValue: [first]
}

As far as I understand, the default value should be:

  defaultValue: ["first"]

paslo22 avatar Feb 08 '24 19:02 paslo22