After reading AWDWR and searching the API, it appears the Rails’
implementation of Migrations has no way to execute a raw SQL
statement. True?
– gw
After reading AWDWR and searching the API, it appears the Rails’
implementation of Migrations has no way to execute a raw SQL
statement. True?
– gw
Greg -
On 9-Nov-07, at 2:31 PM, Greg W. wrote:
After reading AWDWR and searching the API, it appears the Rails’
implementation of Migrations has no way to execute a raw SQL
statement. True?– gw
not true -
execute “insert into easy_as_pie …”
cheers,
Jodi
After reading AWDWR and searching the API, it appears the Rails’
implementation of Migrations has no way to execute a raw SQL
statement. True?
Simple, just use execute:
class MyMigration < ActiveRecord::Migration
def self.up
execute “alter table bar add constraint fk_bar_foo foreign key
(foo_id) references foo(id)”
end
def self.down
# …
end
end
On Nov 9, 2007, at 11:31 AM, Greg W. wrote:
After reading AWDWR and searching the API, it appears the Rails’
implementation of Migrations has no way to execute a raw SQL
statement. True?
Doh! Found it (in AWDWR not in the API docs). Funny, it uses the same
execute command that I opted for when I wrote a migrations framework
for Lasso
– gw
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs