Sunday, August 10, 2008

Cleaning up the database

While I am waiting to get together with the mysql expert, I have decided to go back to my databsae and see if it needs to be cleaned up and tightened up a bit. I think that if I can get that in order that I might be able see a bit clearer on how to connect the foreign keys to each other when setting up the 'add a recipe' form.

This whole connection between tables and foreign keys has got me completely baffled. It is like the text book, Ullman, skirts around it with every database interface it covers. Then, I can't quite pinpoint what I should be querying when I search on the net for a solution. So I come up with nothing in that avenue too.

A couple of things I have done from this:

1. Ensured that every primary key and foreign key are of the same type - SMALLINT(4) UNSIGNED NOT NULL.
2. I fixed up the recipe table so that all the foreign keys are at the top of the table (below the primary key) instead of spread all over the place.
3. Ensured that every primary key is of the same type as their corresponding foreign key in other tables.

No comments: