Hi
How can i combine multiple SQL statements into one place in self.up in
a migration.
For the following, method if i combine 3 SQL statements into one
section I get the error.
######### following works fine
def self.up
execute <<-EOF
CREATE TABLE pks (SNO TINYINT,BUSNO CHAR(20),EXPTIME TIME, PRIMARY
KEY (SNO));
EOF
execute <<-EOF
INSERT INTO pks (SNO,BUSNO,EXPTIME) VALUES('1','5L',080000);
EOF
execute <<-EOF
INSERT INTO pks (SNO,BUSNO,EXPTIME) VALUES('2','5A',081500);
EOF
end
########## it doesn't work
def self.up
execute <<-EOF
CREATE TABLE pks (SNO TINYINT,BUSNO CHAR(20),EXPTIME TIME, PRIMARY
KEY (SNO));
INSERT INTO pks (SNO,BUSNO,EXPTIME) VALUES('1','5L',080000);
INSERT INTO pks (SNO,BUSNO,EXPTIME) VALUES('2','5A',081500);
EOF
end
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---