Skip to content

Commit

Permalink
fixed: SequelizeDatabaseError with mysql
Browse files Browse the repository at this point in the history
SequelizeDatabaseError: BLOB/TEXT column 'name' used in key specification without a key length
  • Loading branch information
demopark committed Aug 31, 2020
1 parent 77088aa commit ed110f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core-concepts/assocs.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,9 @@ Game.belongsTo(Team);
让我们再次使用"船和船长"的示例. 此外,我们将假定船长姓名是唯一的:

```js
const Ship = sequelize.define('ship', { name: DataTypes.TEXT }, { timestamps: false });
const Ship = sequelize.define('ship', { name: DataTypes.STRING }, { timestamps: false });
const Captain = sequelize.define('captain', {
name: { type: DataTypes.TEXT, unique: true }
name: { type: DataTypes.STRING, unique: true }
}, { timestamps: false });
```

Expand Down

0 comments on commit ed110f0

Please sign in to comment.