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

Wrong defaultValue

Open 6aKa opened this issue 3 years ago • 1 comments

                                                                  Table "public.admin"
         Column         |            Type             | Collation | Nullable |              Default              | Storage  | Stats target | Description
------------------------+-----------------------------+-----------+----------+-----------------------------------+----------+--------------+-------------
 id                     | integer                     |           | not null | nextval('admin_id_seq'::regclass) | plain    |              |
 login                  | character varying(255)      |           | not null |                                   | extended |              |
 password_hash          | character varying(255)      |           | not null |                                   | extended |              |
 registered_at          | timestamp without time zone |           | not null | timezone('utc'::text, now())      | plain    |              |
        id: {
          autoIncrement: true,
          type: DataTypes.INTEGER,
          allowNull: false,
          primaryKey: true
        },
        login: {
          type: DataTypes.STRING(255),
          allowNull: false
        },
        password_hash: {
          type: DataTypes.STRING(255),
          allowNull: false
        },
        registered_at: {
          type: DataTypes.DATE,
          allowNull: false,
          defaultValue: 'timezone(utc'
        },

DB: psql (PostgreSQL) 13.5 sequelize-auto: 0.8.8

6aKa avatar Jan 21 '22 14:01 6aKa

see https://github.com/sequelize/sequelize-auto/issues/592 for a proposed solution

mariusa avatar Jan 26 '22 08:01 mariusa