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 
machine.

I have started playing with the import_export extension 
(http://github.com/radiant/radiant-import-export-extension/tree/master) 
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 
plugin.

Here are the steps I used to try this on my dev machine:

1. mysqldump -u root mysite_production > mysite.sql
2. rake production db:export TEMPLATE=db/export.yml
3. rake production db:drop
4. mysqladmin -u root create mysite_production (db:create fails for 
reasons documented elsewhere on this forum)
5. 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:

INSERT INTO `text_assets` VALUES 
(1,'Stylesheet','stylesheet.css','...snip...','2008-07-10 
21:23:37','2008-07-30 02:18:06',1,1,87,NULL);

INSERT INTO `text_assets` VALUES 
(1,NULL,'stylesheet.css','...snip...','2008-07-10 21:23:37','2008-10-02 
21:00:10',1,1,87,NULL);

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:

  TextAssets:
    "1":
      class_name: Stylesheet
      updated_at: 2008-07-30 02:18:06 Z
      updated_by_id: 1
      filter_id:
      lock_version: 87
      id: 1
      created_by_id: 1
      filename: stylesheet.css
      content: |-
        ...snip...
      created_at: 2008-07-10 21:23:37 Z

So, any ideas?
-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to