[Solved] Assign table relationship after I connect to MySQL

Discuss the database features

[Solved] Assign table relationship after I connect to MySQL

Postby however » Sat Aug 11, 2012 6:23 pm

HI everyone,

after i managed to get my Base connected to MySQL and have everything (almost) figured out I was ready to take my DB for a real ride and putting it live in my clinic.

But, after a few final checks I noticed that in the relationship window there was none existing. However, i decided to assign them again manually. It seems the relationships are created but after saving and exiting they disappear! I open the relationship window again and there is nothing there.

I hope that this question is not dumb, but in the project I created for testing (before connecting the DB to MySQL) I had all the table relationships marked by lines and nicely connected.

Is this normal once I let MySQL take over?

This is what i did:
1) created a DB on mySQL using mysql-workbench
2) I connected Base to it and all the tables were there as expected
3) I created all the column assigning 'correctly' Primary and Foreign keys (everything was dbl checked)
4)I connected Base to MySQL with no problems at all (a part that I have to always open OOBase as superuser from the console, because normal use of the icon-tray will not give me full access to the DB) and
5) I recreated all the forms (copy and paste) and adjusted all the values accordingly, table names, button macros, etc.

Everything seems to be in its own place, even if I have not tested the DB with garbage names, addresses, payments, etc.. as I didn't want to lose the chronological order of things, (buttons work, macros are assigned correctly, all spelling has been checked and rechecked, etc.)

So my question is: will the table relationships still be followed even though I can't see them in /tool/relationships?

Once again, any suggestions would be gratefully welcome!

Regards
Last edited by however on Thu Aug 16, 2012 2:25 pm, edited 1 time in total.
ApacheOpenOffice 4.1 on Slackware 14.1
however
 
Posts: 160
Joined: Fri Mar 02, 2012 3:46 pm

Re: I can't assign tble relationship after I connect to MySQ

Postby eremmel » Sat Aug 11, 2012 10:43 pm

I'm not sure, but I think that the relation ships in Base are not exported to the external database, but should be saved in the Base document. I suggest that you design your datamodel in MySQL Workbench and have there the relations. Those relations might be picked up by Base, but I'm not sure.
It's Microsoft marketing that tells you computers are qualified for non-technicians
eremmel
 
Posts: 1037
Joined: Tue Dec 30, 2008 1:15 am

Re: I can't assign tble relationship after I connect to MySQ

Postby however » Sun Aug 12, 2012 1:53 pm

Thank you for your suggestion,

I was about to reply to my own post to further ask whether the relationships are meant to be assigned in MySQL, as suggested.

I'm not a big database genius but it makes sense, as Base just connected to an existing DB where table were already made therefore Base should pick up those relationships which I have now sorted through workbench.

Regards,

p.s.: please, if anyone think my 'sense' doesn't make sense add your comments.
ApacheOpenOffice 4.1 on Slackware 14.1
however
 
Posts: 160
Joined: Fri Mar 02, 2012 3:46 pm

Re: I can't assign tble relationship after I connect to MySQ

Postby rudolfo » Tue Aug 14, 2012 12:20 am

MySQL stores relationships (primary keys, foreign keys, I don't think anything more) in the database. But only if the engine for the database (or/and the tables) is InnoDB. The default MyISAM (at least until 5.1) doesn't know anything about foreign keys and ignores them silently.
So you better check your database version and the kind of backend that you use. Simply running a mysqldump with the name of the database as parameter should show you all this information.
As far as I understood the relation manager stores the graphical layout together with the table structure in the Base file, but the table structure (with the constraints) will always be updated from the database whenever you open the base file again.
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
rudolfo
Volunteer
 
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Re: I can't assign tble relationship after I connect to MySQ

Postby however » Thu Aug 16, 2012 2:22 pm

thank you all!
beautifully explained.
ApacheOpenOffice 4.1 on Slackware 14.1
however
 
Posts: 160
Joined: Fri Mar 02, 2012 3:46 pm


Return to Base

Who is online

Users browsing this forum: No registered users and 5 guests