Ruby on Rails
Friday, April 7, 2017
On Friday, April 7, 2017 at 2:59:40 PM UTC-4, fugee ohu wrote:
Trying to get the right syntax for something like this to put in schema.rb for mysql2ENGINE=InnoDB DEFAULT CHARSET=utf8 PRIMARY KEY=ID AUTOINCREMENTthis isn't valid syntax, anyone can correct? additionally i want id to be int(11) and i want the sql-mode traditionalthanks in advance
This is the show table for "bios" It seems to be id int(11) pri key auto_increment so why do i get duplicate entry 0 for primary key error when i try to import from dumpfile Also, of course I need the id's from the dumpfile to be inserted as the same values otherwise all relations would be borked
| bios | CREATE TABLE `bios` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`artist` varchar(40) COLLATE utf8_unicode_ci DEFAULT NULL,
`bio` longtext COLLATE utf8_unicode_ci,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`genre` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |
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/782dfc94-723b-45cc-9c0f-655f3696a23d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment