views:

210

answers:

2

There is a development_structure.sql inside my /db folder of my rails application (rails 2.3.4, ruby 1.8.7) and I am not sure exactly what it does.

  1. Is it needed for some specific environment? (I think I read somewhere that it's used for tests)
  2. Do I need to add it to my git repository?
A: 

It's created when you run a rake task to clone your development database to your test database. The development database is outputted to SQL which is then read in to your test DB. You can safely delete it.

insane.dreamer
+4  A: 

You should not add it to your git repository.

It is a file created automatically by rails when you run migrations with your database.yml configured to connect against a mysql database. You can view it as an alternative to schema.rb

I believe you can force rails to create it by adding in your environment.rb:

config.active_record.schema_format = :sql

When present this file is used for example by:

rake db:test:clone_structure
Aurélien Bottazzini