Working on BI's historical photo database
The Adaptive DB code has reached the stage where it can be used for other projects, so we took on BI's database of historical photos. This is what I did today:
- Got the spreadsheet from Stew.
- Turned each of the support tables into a db table in PhpMyAdmin.
- Saved the sheet for that table as a tab-delimited CSV file.
- Used Transformer 3, with a JavaScript transform item, to turn the CSV file into an SQL query to insert all the data.
- Inserted the data in PhpMyAdmin using the output from Transformer.
- Added relevant indexes and foreign keys.
- Created the requisite definitions and settings in the
local_classes.phpfile to generate an editor interface for all these tables. - Worked through the main table, creating a new "documents" table which will hold the core data.
- Hooked up the foreign keys in the documents table.
Meanwhile, Stew is transforming the documents table data (2200+ rows) into insert statements for the new table. There are two one-to-many relationships, chapters and keywords. Initially, the original comma-separated values for these will be inserted into the mySQL table in temporary fields; we will then write PHP to parse the fields and generate the required records in the related tables. Once that's done, we can delete the original string fields.
Finally, I'll have to create a local_classes definition file for the documents table. It probably deserves its own editing page -- the other page is already heavy with data and takes 8 seconds to load.