# Schema dumping

**URL:** <https://www.ruby-forum.com/t/schema-dumping/78373>\
**Category:** Engines Development\
**Created:** [March 8, 2006, 12:00pm UTC](https://www.ruby-forum.com/t/schema-dumping/78373 "2006-03-08T12:00:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ea666f/32.png) [@jeffl](https://www.ruby-forum.com/u/jeffl)\
**Post date:** [March 8, 2006, 12:00pm UTC](https://www.ruby-forum.com/t/schema-dumping/78373/1 "2006-03-08T12:00:16Z")

</div>

When using ‘rake db\_schema\_dump’ Rails will ignore its own schema  
version table, so I’m trying to extend it to ignore engines’ as well.  
It’s a bit tough though because of the way Rails loads the  
SchemaDumper class… I’m still playing with it.

Anyway, if I get it working, shall I supply a patch?

Sidenote: I hate Rails making a table for schema info… so I’m doubly  
pained to see engines add another for the same reason. I was thinking  
it would be nice of engines just extended the Rails table… I don’t  
think Rails cares of there’s extra columns and as long as the app  
migration version is the first record, it should keep working.  
Thoughts?

–  
Jeff L.  
[http://blogrium.com/](http://blogrium.com/)

---

<div class="post-metadata">

**Author:** ![jeffl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ea666f/32.png) [@jeffl](https://www.ruby-forum.com/u/jeffl)\
**Post date:** [March 8, 2006, 12:06pm UTC](https://www.ruby-forum.com/t/schema-dumping/78373/2 "2006-03-08T12:06:18Z")

</div>

I just realized extended the rails version table would solve the  
original issue… which is nice because it looks like it might be  
impossible to properly extend the SchemaDumper class from a plugin or  
the environment the way the rake task loads it.

I’m a rake noob, can we overwrite rake tasks?

On 3/8/06, Jeff L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> think Rails cares of there’s extra columns and as long as the app  
> migration version is the first record, it should keep working.  
> Thoughts?
> 
> –  
> Jeff L.  
> [http://blogrium.com/](http://blogrium.com/)

–  
Jeff L.  
[http://blogrium.com/](http://blogrium.com/)

---

<div class="post-metadata">

**Author:** ![jeffl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ea666f/32.png) [@jeffl](https://www.ruby-forum.com/u/jeffl)\
**Post date:** [March 8, 2006, 10:58pm UTC](https://www.ruby-forum.com/t/schema-dumping/78373/3 "2006-03-08T22:58:51Z")

</div>

Perhaps the best solution would be to petition the core to modify the  
way this schema\_info is created… rather than a single column/single  
row table, we could have a key/value pair with which to register  
version information.

name varchar(255) default null  
version int(11) default null

insert into schema\_info (name, version) values (‘application’, 12);  
insert into schema\_info (name, version) values (‘login\_engine’, 1);  
insert into schema\_info (name, version) values (‘riki\_engine’, 3);

Duane J.  
(canadaduane)  
[http://blog.inquirylabs.com/](http://blog.inquirylabs.com/)

---

<div class="post-metadata">

**Author:** ![jeffl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ea666f/32.png) [@jeffl](https://www.ruby-forum.com/u/jeffl)\
**Post date:** [March 9, 2006, 2:40am UTC](https://www.ruby-forum.com/t/schema-dumping/78373/4 "2006-03-09T02:40:31Z")

</div>

Ah, totally didn’t think of that way. 😛

On 3/8/06, Duane J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> insert into schema\_info (name, version) values (‘riki\_engine’, 3);
> 
> > definitely be worthy of discussion.
> > 
> > > [http://blogrium.com/](http://blogrium.com/)  
> > > ~

–  
Jeff L.  
[http://blogrium.com/](http://blogrium.com/)

---

<div class="post-metadata">

**Author:** ![jeffl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ea666f/32.png) [@jeffl](https://www.ruby-forum.com/u/jeffl)\
**Post date:** [March 8, 2006, 12:09pm UTC](https://www.ruby-forum.com/t/schema-dumping/78373/5 "2006-03-08T12:09:19Z")

</div>

Patching the schema dump to ignore the engine\_schema\_info table was on  
my hitlist too, but a patch would be more than welcome, so please do  
look into that if you can.

W.r.t. just modifying the existing schema\_info table, I considered  
that but came to the conclusion that it would be the worse of two  
evils; adding version information about individual engines would, as  
you say, involve adding new columns each time a new engine is  
encountered, which then means that the migration system has to ALTER  
tables rather than just adding rows. It also puts the engine schema  
information at the mercy of whatever processes are playing with the  
schema info table, which could concievably be a bad thing. Perhaps I’m  
being overprotective here though… I do try and keep an open mind  
though - if you wanted to work up a patch for that too, it would  
definitely be worthy of discussion.

- james

On 3/8/06, Jeff L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> think Rails cares of there’s extra columns and as long as the app

–

- J \*  
~
