programing

동기화 시 MariaDB / Sequetize SQL 구문 오류 발생

cafebook 2023. 8. 11. 22:35
반응형

동기화 시 MariaDB / Sequetize SQL 구문 오류 발생

const User = sequelize.define('User', {
  Points: {
    type: DataTypes.NUMBER,
    defaultValue: 0,
    allowNull: false
  },
  UserId: {
    type: DataTypes.STRING,
    allowNull: true
  }
}, 
{
  sequelize,
  modelName: 'User',
  tableName: 'Points'
});
User.sync()

이 코드는 MariaDB 오류를 제거합니다.

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NOT NULL DEFAULT 0, `UserId` VARCHAR(255) DEFAULT '', `createdAt` DATETIME NO...' at line 1

누가 좀 도와주시겠어요?저는 이런 종류의 일은 처음이라 잘 알지 못합니다.감사합니다!

언급URL : https://stackoverflow.com/questions/70583429/mariadb-sequelize-sql-syntax-error-when-syncing

반응형