Sorry if I wasn't clear before. Changes to structure.sql are only ever
committed in development. When production runs a db:migrate it spits out a
new version of structrue.sql.  If I run a `git status` on production and
see changes to structure.sql I know something is out of sync with the SCM
deployed code and production. Ideally this would never happen, but I've
helped out on projects where legacy columns were on production tables that
were not reflected in the structure.sql file.

Does that clarify my use case?

Seth


On Sun, Feb 2, 2014 at 11:34 PM, Emil S <[email protected]> wrote:

> Seth, please correct me if I'm mistaken. Since the branch that gets
> deployed in production already has a structure.sql , we can always compare
> that with the development branches. What's the need for having a migration
> task prepare structure.sql in a production environment ?
>
>
> On 1 February 2014 00:39, Seth Faxon <[email protected]> wrote:
>
>> I occasionally run diff's on the production schema.rb or structure.sql
>> against what is in git to be sure development environments are staying in
>> sync with production.
>>
>>
>> On Fri, Jan 31, 2014 at 10:13 AM, Emil S <[email protected]> wrote:
>>
>>>  Currently the `db:migrate` rake task runs `dump` at the end which
>>> dumps the database structure to `schema.rb` / `structure.sql`. This will be
>>> useful in development environment but I can't see a reason why this should
>>> run in production environment. Removing this step in production would make
>>> deployments faster, I believe. Do others think that this should be fixed ?
>>>
>>> [Rails code that invokes `dump`](
>>> https://github.com/rails/rails/blob/8a5b480ebb46215210294b87a7ed9f1d8a032312/activerecord/lib/active_record/railties/databases.rake#L37)
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ruby on Rails: Core" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/rubyonrails-core.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/rubyonrails-core.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/rubyonrails-core.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to