SailsJS - How to specify string attribute length without getting error when creating record?

后端 未结 2 967
陌清茗
陌清茗 2021-01-06 01:08

I\'m using Sails 0.9.8 paired with MySQL and wanting to do something like this

localhost:1337/player/view/

instea

2条回答
  •  不知归路
    2021-01-06 01:27

    The marked answer is quiet old. As per the latest sails version (1.0.2 as of the date of writing this answer),

    I used the columnType attribute like this:

    attributes: {
    
      longDescription: {
        type: 'string',
        columnType: 'text'
      }
    }
    

提交回复
热议问题