Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplification proposal for the output formats. #653

Open
adminy opened this issue Aug 26, 2023 · 1 comment
Open

Simplification proposal for the output formats. #653

adminy opened this issue Aug 26, 2023 · 1 comment

Comments

@adminy
Copy link

adminy commented Aug 26, 2023

Suppose instead of es5, es6, esm, ts types, it outputted this json structure:

[
  {
    "tableName": "models"
  },
  {
    "id": {
      "type": "DataTypes.INTEGER(11)",
      "allowNull": false,
      "primaryKey": true,
      "comment": "null",
      "autoIncrement": true
    },
    "dbname": {
      "type": "DataTypes.STRING(45)",
      "allowNull": false,
      "autoIncrement": false,
      "comment": "null"
    },
    "tablename": {
      "type": "DataTypes.STRING(45)",
      "allowNull": false,
      "autoIncrement": false,
      "comment": "null"
    },
    "weekday": {
      "type": "DataTypes.ENUM(\"Sun\",\"Mon\",\"Tues\",\"Wed\",\"Thur\",\"Fri\",\"Sat\")",
      "allowNull": false,
      "autoIncrement": false,
      "comment": "null"
    },
    "createdDate": {
      "type": "DataTypes.DATE",
      "allowNull": true,
      "defaultValue": "CURRENT_TIMESTAMP",
      "autoIncrement": false,
      "comment": "null"
    }
  }
]

Which makes it easy for you to simply Sequelize.import it.

It is a more convenient and useful from any js version to use the json format rather than version specific javascript code.

@siniradam
Copy link

This is a good idea. I forked sequelize-auto I'd like to try this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants