SQL setup
The creation of the MySQL schema has been difficult, due mostly to the requirement to include multiple authors, each of whom might tell the *same* story in different ways (different characters, places etc.). EVERYTHING needs a 'related-to' table and a relationship-to-citation table. Foreign Keys will be crucial to maintaining data integrity, and it's been tough to learn it at the same time that I'm trying to understand the basic concepts. It's hard, but I *think* I've discovered something peculiar about MySQL**:
If you create a structure with constraints and no data, then try to add data, MySQL barfs. If you create your basic schema and insert a smidgen of data in to the tables that will have constraints, you can then go back and create your constraints and add new data in the constrained fields quite happily.
Note on PHPmyAdmin: constrained fields will show a dropdown list that looks similar to this:
-3
-2
-1
1-
2-
3-
As far as I can tell there is no difference between -3 and 3-, but I'm only using a dump file to view the data, and I don't really understand this stuff too well right now.
**this appears to be a reported bug that has been fixed in 5.1.13 (we're running 5.0.51) - good job we're rebuilding.