Open n4an opened 3 years ago
@Mitch-i Thanks for posting! We'll take a look as soon as possible.
In the mean time, there are a few ways you can help speed things along:
Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly.
For help with questions about Sails, click here.
Or is not need
primary key is automatically indexed in MySQL because primary key, index, etc gets stored into B-trees. All engines including InnoDB as well as MyISAM automatically supports the primary key to be indexed.
Hi @Mitch-i, You can specify a primaryKey
by setting primaryKey: 'someAttribute',
at the top level of the model.
https://sailsjs.com/documentation/concepts/models-and-orm/model-settings#?primarykey
Node version: Sails version (sails): ORM hook version (sails-hook-orm): Sockets hook version (sails-hook-sockets): Organics hook version (sails-hook-organics): Grunt hook version (sails-hook-grunt): Uploads hook version (sails-hook-uploads): DB adapter & version (e.g. sails-mysql@5.55.5): Skipper adapter & version (e.g. skipper-s3@5.55.5):
In the
id
attribute of modelrole
: TheprimaryKey
property can no longer be specified on an attribute in Sails 1.0. If you want to declareid
to be the primary key ofrole
, setprimaryKey: 'id'
at the top level of the model.