I am not familiar with "SET" but you can pass any sql in a migration
with the "Execute" command
Like so: (this is adding a foreign key and a GUID id rather than an
auto-increment integer, but you get the point.)
class CreateSeats < ActiveRecord::Migration
def self.up
create_table(:seats, :id => false) do |t|
t.string :id, :limit => 32, :null => false
t.string :venue_id, :limit => 32, :null => false
t.string :name
t.string :section
t.string :seat_row
t.string :seat_number
t.string :seat_type
t.timestamps
end
execute "ALTER TABLE `seats` ADD PRIMARY KEY (`id`)"
#add a foreign key
execute "ALTER TABLE seats ADD CONSTRAINT fk_seats_venues FOREIGN
KEY (venue_id) REFERENCES venues(id)"
end
def self.down
#Drop foreign key
execute "ALTER TABLE seats DROP FOREIGN KEY fk_seats_venues"
drop_table :seats
end
end
On Jan 18, 12:35 am, Dave <[email protected]> wrote:
> Is it possible to use Mysql column type SET within RoR migration files?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---