diff options
author | Lakshay arora <carefreelakshay97@gmail.com> | 2018-03-27 07:48:50 +0300 |
---|---|---|
committer | MaurĂcio Meneghini Fauth <mauriciofauth@gmail.com> | 2018-03-27 22:02:33 +0300 |
commit | 2aecbf41e1e0672cce94a7fc5f07d0cbe8587320 (patch) | |
tree | 7e8ee29aaa92f76d2dc818b2282226c51049c956 /templates | |
parent | 046bc0f00981671b05b63eda31ea83adf254d660 (diff) |
Fixes error in foreign key sql generation + drop foreign key contraint (#14031)
* Fixes error in foreign key sql genration, issue #14030
Changed:
templates/table/relation/foreign_key_row.twig
The destination_column_names were getting passed as a 1d array, the names when extracted gave a string. Passing it as a 2d array (see templates/table/relation/foreign_key_row.twig lines 123,133) fixes the issue.
Sign-Off-By: Lakshay arora (b16060@students.iitmandi.ac.in)
* Fixes error in foreign key sql generation + drop foreign key contraint, issue #14030
Changed:
templates/table/relation/foreign_key_row.twig
Fix #13941
Fix #14009
Close #14037
Close #14010
Signed-off-by: Lakshay arora <b16060@students.iitmandi.ac.in>
(cherry picked from commit 00b59624e35cc39fd7bcea68453cc0f98c8dfeac)
Signed-off-by: MaurĂcio Meneghini Fauth <mauriciofauth@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/table/relation/foreign_key_row.twig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/templates/table/relation/foreign_key_row.twig b/templates/table/relation/foreign_key_row.twig index c56ce6f0ea..caab9a4251 100644 --- a/templates/table/relation/foreign_key_row.twig +++ b/templates/table/relation/foreign_key_row.twig @@ -4,7 +4,7 @@ {% set js_msg = '' %} {% set this_params = null %} {% if one_key['constraint'] is defined %} - {% set drop_fk_query = 'ALTER TABLE ' ~ Util_backquote(table) + {% set drop_fk_query = 'ALTER TABLE ' ~ Util_backquote(db) ~ '.' ~ Util_backquote(table) ~ ' DROP FOREIGN KEY ' ~ Util_backquote(one_key['constraint']) ~ ';' %} @@ -18,7 +18,7 @@ ) } %} {% set js_msg = Sanitize_jsFormat( - 'ALTER TABLE ' ~ table + 'ALTER TABLE ' ~ db ~ '.' ~ table ~ ' DROP FOREIGN KEY ' ~ one_key['constraint'] ~ ';' ) %} @@ -120,7 +120,7 @@ {% for foreign_column in one_key['ref_index_list'] %} <span class="formelement clearfloat"> {% include 'table/relation/relational_dropdown.twig' with { - 'name': 'destination_foreign_column[' ~ i ~ ']', + 'name': 'destination_foreign_column[' ~ i ~ '][]', 'title': 'Column'|trans, 'values': unique_columns, 'foreign': foreign_column @@ -130,7 +130,7 @@ {% else %} <span class="formelement clearfloat"> {% include 'table/relation/relational_dropdown.twig' with { - 'name': 'destination_foreign_column[' ~ i ~ ']', + 'name': 'destination_foreign_column[' ~ i ~ '][]', 'title': 'Column'|trans, 'values': [], 'foreign': '' |