If possible, I want to NOT assume that I am using a particular database
and that the development and production databases are on the same
I have started playing with the import_export extension
to see if it could help form the basis of my deployment strategy.
I have run into a problem, however, and I wonder if anybody else has
tried this. It appears to not work well with the styles_n_scripts
Here are the steps I used to try this on my dev machine:
- mysqldump -u root mysite_production > mysite.sql
- rake production db:export TEMPLATE=db/export.yml
- rake production db:drop
- mysqladmin -u root create mysite_production (db:create fails for
reasons documented elsewhere on this forum)
- rake production db:import TEMPLATE=db/export.yml
The result is that the site is unable to use the stylesheet I stored
using the styles_n_scripts plugin.
It is interesting to note that the tables created by the
styles_n_scripts plugin appear to be there, and my stylesheet appears to
be in the database – with one missing attribute.
I used mysqldump to back up the newly imported version of the database.
Diffing the original mysqldump (working) and new mysqldump (non-working)
output reveals this:
Notice the NULL second field in the imported, non-working database.
This second field is ‘class_name.’
The problem appears (to me at least) to be with the import, not export.
Notice that the missing field does indeed appear in the export.yml file:
updated_at: 2008-07-30 02:18:06 Z
created_at: 2008-07-10 21:23:37 Z
So, any ideas?