mardi 28 juin 2016

Relationships: Ember data & MySQL

Hei guys,

I would like to understand how to connect MySQL and Ember data relationships.

For example, i have a user model:

// app/models/user.js

export default({
  collections: hasMany('collection')
});


// app/models/collection.js:

export default({
  user: belongsTo('user')
});

This part is very simple, i get it.

Now, the problem: How should i express the relationship in the MySQL? Using the same names (columns) to add foreign keys?

Thanks in advance1




Aucun commentaire:

Enregistrer un commentaire