# Schema.dump chokes on RAW type

**URL:** <https://www.ruby-forum.com/t/schema-dump-chokes-on-raw-type/150459>\
**Category:** Rails\
**Created:** [October 8, 2008, 9:29pm UTC](https://www.ruby-forum.com/t/schema-dump-chokes-on-raw-type/150459 "2008-10-08T21:29:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsanheim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Post date:** [October 8, 2008, 9:29pm UTC](https://www.ruby-forum.com/t/schema-dump-chokes-on-raw-type/150459/1 "2008-10-08T21:29:44Z")

</div>

I haven’t seen anyone mention this yet.

The tail end of the migration process is a call to schema.dump. Our  
primary keys are uuids and these choke schema.dump on both oracle and  
postgres. The latter fails silently (skips three tables) while the  
former complains about the RAW(16) in each of the three tables.

Anyone had a similar experience?

---

<div class="post-metadata">

**Author:** ![rsanheim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Post date:** [October 8, 2008, 9:39pm UTC](https://www.ruby-forum.com/t/schema-dump-chokes-on-raw-type/150459/2 "2008-10-08T21:39:19Z")

</div>

On Oct 8, 8:29 pm, Rob S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I haven’t seen anyone mention this yet.
> 
> The tail end of the migration process is a call to schema.dump. Our  
> primary keys are uuids and these choke schema.dump on both oracle and  
> postgres. The latter fails silently (skips three tables) while the  
> former complains about the RAW(16) in each of the three tables.
> 
> Anyone had a similar experience?

If you are using stuff the ruby schema dumper does not understand you  
may just have to switch the schema dumper format to :sql (in  
environment.rb), although this does tend to kill cross database  
compatibility.

Fred

---

<div class="post-metadata">

**Author:** ![rsanheim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Post date:** [October 8, 2008, 10:00pm UTC](https://www.ruby-forum.com/t/schema-dump-chokes-on-raw-type/150459/3 "2008-10-08T22:00:57Z")

</div>

Frederick C. wrote:

> On Oct 8, 8:29ï¿½pm, Rob S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> If you are using stuff the ruby schema dumper does not understand you  
> may just have to switch the schema dumper format to :sql (in  
> environment.rb), although this does tend to kill cross database  
> compatibility.
> 
> Fred

OK, I’ll look into that. Thank

---

<div class="post-metadata">

**Author:** ![rsanheim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Post date:** [October 8, 2008, 10:41pm UTC](https://www.ruby-forum.com/t/schema-dump-chokes-on-raw-type/150459/4 "2008-10-08T22:41:02Z")

</div>

Rob S. wrote:

> Frederick C. wrote:
> 
> > On Oct 8, 8:29ï¿½pm, Rob S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> > wrote:
> > 
> > If you are using stuff the ruby schema dumper does not understand you  
> > may just have to switch the schema dumper format to :sql (in  
> > environment.rb), although this does tend to kill cross database  
> > compatibility.
> > 
> > Fred
> 
> OK, I’ll look into that. Thank

Setting ‘config.active\_record.schema\_format = :sql’ in environment.rb  
appears to have turned dump off altogether. Was that the expected  
result?

---

<div class="post-metadata">

**Author:** ![rsanheim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Post date:** [October 9, 2008, 10:12am UTC](https://www.ruby-forum.com/t/schema-dump-chokes-on-raw-type/150459/5 "2008-10-09T10:12:31Z")

</div>

On 8 Oct 2008, at 21:41, Rob S. wrote:

> > > may just have to switch the schema dumper format to :sql (in  
> > > environment.rb), although this does tend to kill cross database  
> > > compatibility.
> > > 
> > > Fred
> > 
> > OK, I’ll look into that. Thank
> 
> Setting ‘config.active\_record.schema\_format = :sql’ in environment.rb  
> appears to have turned dump off altogether. Was that the expected  
> result?

Yes. Instead db/development.sql (if you are doing this in the  
development environment) is populated. IIRC it’s not automatically  
updated after migrations have run.

Fred

---

<div class="post-metadata">

**Author:** ![rsanheim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/47e85d/32.png) [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Post date:** [October 10, 2008, 1:30am UTC](https://www.ruby-forum.com/t/schema-dump-chokes-on-raw-type/150459/6 "2008-10-10T01:30:25Z")

</div>

Frederick C. wrote:

> On 8 Oct 2008, at 21:41, Rob S. wrote:
> 
> > > > may just have to switch the schema dumper format to :sql (in  
> > > > environment.rb), although this does tend to kill cross database  
> > > > compatibility.
> > > > 
> > > > Fred
> > > 
> > > OK, I’ll look into that. Thank
> > 
> > Setting ‘config.active\_record.schema\_format = :sql’ in environment.rb  
> > appears to have turned dump off altogether. Was that the expected  
> > result?
> 
> Yes. Instead db/development.sql (if you are doing this in the  
> development environment) is populated. IIRC it’s not automatically  
> updated after migrations have run.
> 
> Fred

Fred, Thanks, I’m not seeing anything but the same dud schema.rb being  
generated so I’m still doing something wrong (using rake db:schema:dump)
