I receive the error message “Database failure. Please refer to sugarcrm.log for details” after clicking save and deploy when creating a relationship. I was attempting to create a one to many relationship between the accounts module and a custom module named “Product Information”.
I see 2 things wrong with the insert query found in the log; the value to be inserted into the field “join_key_rhs” is 65 characters. The field is defined as nchar(64). Also the value for relationship_type is “many to many” which is incorrect. I am using Sql Server 2008
From the log:
09/16/14 11:43:33 [788][939d0275-f1f3-38a2-3bac-53fb284fe4ff][FATAL] Query Failed:INSERT into relationships (id,relationship_name,lhs_module,lhs_table,lhs_key,rhs_module,rhs_table,rhs_key,join_table,join_key_lhs,join_key_rhs,relationship_type) values (N’16dfe4e0-b318-c185-72b3-54185a2d2c50’,N’accounts_prdin_product_information_1’,N’Accounts’,N’accounts’,N’id’,N’PrdIn_Product_Information’,N’prdin_product_information’,N’id’,N’accounts_prdin_product_information_1_c’,N’accounts_prdin_product_information_1accounts_ida’,N’accounts_prdin_product_information_1prdin_product_information_idb’,N’many-to-many’)::: [Microsoft][SQL Server Native Client 11.0][SQL Server]String or binary data would be truncated.
There are also several of the following error:
09/16/14 13:28:04 [2968][a1c44b41-c4b8-5572-0fe3-53fb28434ff8][FATAL] Query Failed:SELECT * FROM config
where name = N’module_twitter’ and value = 1;::: [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near ‘`’.