View Full Version : Entity Relationship Diagram for DB?

2013.05.23, 02:03 PM
Hey guys,

There may be a way to generate this from RealStudio (do you use a free IDE by the way?) but I've not found it yet.

I'm adding "Car Setup Sheets" to the program as I use the software a lot in my basement (great work by the way). This will allow me not only to track the car setup but also to see the statistical differences in times through each setup.

I've already added a page and starting to look at the back end code (took me an hour or so to get used to RealBasic!). I've started to look at the DB relationships but wondered if anyone had a diagram (sketch or other) to short cut this. For example. I've already seen that the summary_table is a junction table creating the many to many relationship between racer_table and race_table (using the event_id and racer_id).

Any other info would be great. I'll probably end up creating a new table called car_setup_table and use another joining table to link to the race_table. Any info would be handy though.

It's been a few years since I looked into db relationships but it's all starting to come back :)



2013.05.23, 09:52 PM
RealStudio (soon to be renamed to Xojo) does not have a tool for this as far as I know. Though with the rename to Xojo they are releasing a completely new IDE so maybe it will have this feature, I can hope at least. When Xojo is released the IDE will finally be free. It is supposed to be released on June 4th last I read.

Not surprised it took a while to get used to the code. I (along with another person that helped early on) did not have any idea what we were doing when this project started so we learned along the way, some ugly code in there still....

I do not have a diagram but I can generate something. There may be tools out there to do it automatically even. The database is just a standard SQLite database. Though because it is SQLite the relationships between tables are not enforced by the database. SQLite in the version I used does not have any true understanding of a foreign key. SQLite has since added that capability but I have not converted things as it is already working so why introduce bugs.

I would definitely recommend using a different table. This way any changes I make to the database would not impact what you are doing. At times I have added columns, renamed columns etc. so this would minimize conflicts.

If you have not already figured out what you need I should be able to create a diagram and post it tomorrow.

Maybe the work you are doing should be included in the main project? Something to think about at least.

2013.05.24, 07:23 PM
OK, I made a quick diagram of the database. I excluded a few fields and tables that are no longer used for simplicity sake, and it does not include the newest tables in the source code as I may still change that structure but that should not impact what you are doing.

As you can see the database is pretty basic. You are just concerned about the 4 main tables, race_table, racer_table, summary_table and laps_table


2013.06.04, 07:46 PM
Perfect thank you. I'll make my mods and check in the changes. Sorry I'm only getting to do this sporadically