简体   繁体   中英

How do I set the built in 'Users' to use a datasource using loopback?

I want to set the built in user model to use a MySQL server for data storage. But I am not sure how to migrate over,

I have this snippet in model-config.js:

"User": {
  "dataSource": "db"
},
"AccessToken": {
  "dataSource": "db",
  "public": false
},
"ACL": {
  "dataSource": "db",
  "public": false
},
"RoleMapping": {
  "dataSource": "db",
  "public": false
},
"Role": {
  "dataSource": "db",
  "public": false
}

Now I would assume I set the datasource to a user datasource I created for the User . How do I got about the proper schema, and what about these other default models?

Change the the dataSource property's value to the name of your MySQL datasource.

...
"User": {
  "dataSource": "mySqlDs" //name of your data source
}
...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM