-
Notifications
You must be signed in to change notification settings - Fork 9
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
Constraint can't reference different database #259
Comments
Think this fixes it (Note the lines might be off due to alot of local mods in this file). Wasn't sure if you had a better way to handle this (haven't commit anything), but it seems to solve the optional database.tablename format. @@ -1185,7 +1213,12 @@ class Modyllic_Parser {
$this->get_reserved();
$key->weak = true;
}
+
+ // Handle the '{database}.{table}' format
$key->references['table'] = $this->get_ident();
+ if ($this->maybe('.')) {
+ $key->references['table'] .= '.' . $this->get_ident();
+ }
|
…fferent database
Fixed in my branch, but couldn't commit to yours. Says I don't have permission. I can just commit to mine and you can merge in changes from that one if you want my fixes. |
Make a branch in your fork with the change, then a pull request for it. Pull requests are located in the icon just below the issues icon. Alternatively, when you're viewing your fork it should show you the recently created branch with a pull request button. We never (almost) never commit to OnlineBuddies/Modyllic– with the exception of releases, it's a merge-only branch. Merges are never done by the person who made the change, they're always done via pull request and someone else reviews the changes and accepts them or asks for changes. |
My suspicion is that this patch will still produce errors, just not parse errors. I would expect it to produce an error of this kind:
These show up at the top of dumps and diffs and will halt migrations unless you Modyllic is distinctly lacking in cross-schema support. Ideally you'd be able to have it load multiple schema and thus it'd be able to validate this sort of cross schema link. That being said though, it'd require not insubstantial refactoring. One interim measure might be to add a database key to Modyllic_Schema_Index_Foreign and populate that (rather then cramming both into the table name) and then skip validation if that's set (or, perhaps, if it differs from $schema->name). |
Seems to be an issue referencing a table in a different db.
The text was updated successfully, but these errors were encountered: