# Migration oracle auto\_increment

**URL:** <https://www.ruby-forum.com/t/migration-oracle-auto-increment/165278>\
**Category:** Rails\
**Created:** [April 11, 2009, 7:43am UTC](https://www.ruby-forum.com/t/migration-oracle-auto-increment/165278 "2009-04-11T07:43:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![robredford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ea924/32.png) [@robredford](https://www.ruby-forum.com/u/robredford)\
**Post date:** [April 11, 2009, 7:43am UTC](https://www.ruby-forum.com/t/migration-oracle-auto-increment/165278/1 "2009-04-11T07:43:00Z")

</div>

I have a schema for ~15 tables in MySQL. I need to migrate it to Oracle  
though I’ve never used Oracle before. I see that Oracle doesn’t have an  
auto\_increment built in. One must create a trigger table for each  
auto\_incrementing id. I’m contemplating translating my MySQL schema  
into a Ruby migration script.

Do you know if Ruby migrations will generate enough SQL to implement  
these features seemlessly:

1. auto increment id column
2. foreign key constraints
3. partition tables (by range on to\_days())
4. specify data column sizes (e.g. in SQL I can say varchar(10)) but in  
my limited migrations exposure, it looks like the same column would be  
described simply as string.

I’d consider porting to migrations if it bought me a free translation to  
Oracle SQL, including the triggers for auto increment, even if I had to  
hand tune the result a bit. Otherwise I may wait and use migrations at  
a later date.
