Giter Site home page Giter Site logo

Comments (4)

durango avatar durango commented on May 7, 2024

@Sawtaytoes any way to copy & paste an sql file for me to replicate? Sorry for missing this issue as well, I didn't see it in my inbox at all.

from sequelize-auto.

Sawtaytoes avatar Sawtaytoes commented on May 7, 2024

What would you like for a SQL file? The schema? Actual data?

from sequelize-auto.

durango avatar durango commented on May 7, 2024

Just the schema please

from sequelize-auto.

durango avatar durango commented on May 7, 2024

Was able to generate primary keys and foreign keys on column names without having the column name set to id:

/* jshint indent: 2 */

module.exports = function(sequelize, DataTypes) {
  return sequelize.define('disreports', {
    ORGANIZATION_ID: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      primaryKey: true,
      references: {
        model: 'cxm_company',
        key: 'ORGANIZATION_ID'
      }
    },
    COMPANY_ID: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      primaryKey: true,
      references: {
        model: 'cxm_company',
        key: 'COMPANY_ID'
      }
    },
    REPORT_UNAME: {
      type: DataTypes.STRING,
      allowNull: false,
      primaryKey: true
    },
    PHYSICAL_NAME: {
      type: DataTypes.STRING,
      allowNull: true
    },
    REPORT_MODULE_UNAME: {
      type: DataTypes.STRING,
      allowNull: true
    },
    MODULE_UNAME: {
      type: DataTypes.STRING,
      allowNull: true
    },
    DESCRIPTION: {
      type: DataTypes.STRING,
      allowNull: true
    },
    PATH: {
      type: DataTypes.STRING,
      allowNull: true
    },
    MENU_LOCATION: {
      type: DataTypes.STRING,
      allowNull: true
    },
    MENU_ORDER: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
      defaultValue: '0'
    },
    DISPLAY_NAME: {
      type: DataTypes.STRING,
      allowNull: true
    },
    IS_ENABLED: {
      type: DataTypes.BOOLEAN,
      allowNull: true,
      defaultValue: '1'
    },
    DISPLAY_ICON: {
      type: DataTypes.STRING,
      allowNull: true
    },
    CREATE_USER: {
      type: DataTypes.STRING,
      allowNull: true
    },
    CREATE_DATE: {
      type: DataTypes.DATE,
      allowNull: true
    },
    UPDATE_USER: {
      type: DataTypes.STRING,
      allowNull: true
    },
    UPDATE_DATE: {
      type: DataTypes.DATE,
      allowNull: true
    }
  }, {
    tableName: 'disreports'
  });
};

Closing for now

from sequelize-auto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.