GithubHelp home page GithubHelp logo

Comments (5)

alex-thompson avatar alex-thompson commented on May 13, 2024 1

For anyone else who stumbles across this today, you can keep UNIQUEIDENTIFIER (versus CHAR with DataTypes.UUID), by doing:

id: {
  type: 'UNIQUEIDENTIFIER',
  defaultValue: DataTypes.UUIDV4,
  primaryKey: true
},

Just keep the defaultValue as DataTypes.UUIDV4 versus the literal newid() to avoid breaking the model's associations.

from sequelize-auto.

deksden avatar deksden commented on May 13, 2024

Here is PR for this feature: #79

from sequelize-auto.

leolorenzoluis avatar leolorenzoluis commented on May 13, 2024

@deksden Producing DataTypes.UUIDV4 breaks SQL Server. Getting an error that column data type UUIDv4 is not found. Changing the DataType to UUID fixes it. Could you double check?

from sequelize-auto.

deksden avatar deksden commented on May 13, 2024

Any code/sample? What SQL Server version?

As for time of that issue 2 yrs ago all was fine with tested SQL server versions

from sequelize-auto.

josuerodcat90 avatar josuerodcat90 commented on May 13, 2024

For anyone else who stumbles across this today, you can keep UNIQUEIDENTIFIER (versus CHAR with DataTypes.UUID), by doing:

id: {
  type: 'UNIQUEIDENTIFIER',
  defaultValue: DataTypes.UUIDV4,
  primaryKey: true
},

Just keep the defaultValue as DataTypes.UUIDV4 versus the literal newid() to avoid breaking the model's associations.

Thanks a lot!!!, this still working if any else stuck with this.

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.