On Fri, Mar 9, 2018 at 12:42 AM, Robert Phillips
<robert.phillips37@gmail.com> wrote:
> I can't get a create_table statement onto one line
>
> irb(main):019:0> ActiveRecord::Migration.create_table :wers { |t| t.string
> :name }
> SyntaxError: (irb):19: syntax error, unexpected '{', expecting end-of-input
> Migration.create_table :wers { |t| t.string :name }
ActiveRecord::Migration.create_table(:wers){ |t| t.string :name }
-- create_table(:wers)
(60.1ms) SET NAMES utf8, @@SESSION.sql_mode =
CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'),
',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0,
@@SESSION.wait_timeout = 2147483
(192.1ms) CREATE TABLE `wers` (`id` bigint NOT NULL AUTO_INCREMENT
PRIMARY KEY, `name` varchar(255)) ENGINE=InnoDB
-> 0.4446s
=> nil
2.5.0 (main):0 >
You need to separate the argument ":wers" from the block with parens.
HTH!
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yBZ_EHZ_WPNjD5kuK6OCA62SKH0XJudsjphBmOCfgFjdg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment