-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table relationships question #3
Comments
There is nothing (yet) in JSONModel nor SQLAbstract to set foreign key constraints. To add support for foreign keys would imply two modifications: a) Add a Instead of:
We would have:
Where The definition of PRIMARY KEY constraint is moved outside of SQLAbstract. In JSONModel. Were a function tagsTable (SQLAbstract $sql) {
return new JSONModel($sql, array(
'name' => 'tags',
'primary' => array(
'tag_task', 'tag_label'
),
'foreign' => array(
'tag_task' => taskTable($sql)
),
'types' => array(
'tag_task' => 'intval'
)
));
} Besides generating FOREIGN KEY constraints, this |
Having a With the above example, for instance to relate tasks to tags selected by safe options: $tagsTable->relate($options); |
How can I set 'foreign key' constraints in MySQL using JSONModel/SQLAbstract stack? These are important for my schema. Can I do it?
The text was updated successfully, but these errors were encountered: