Ruby on Rails
Saturday, April 8, 2017
Fugee,
You keep making really asinine remarks. Eluding to someone trying to help you as Lee Harvey Oswald is just distasteful.
Either get your attitude straight or get off this mailing list.
Sent from my iPhone
Sent from my iPhone
--
On Friday, April 7, 2017 at 4:05:05 PM UTC-4, Rob Biedenharn wrote:On 2017-Apr-7, at 15:26 , fugee ohu <fuge...@gmail.com> wrote:
On Friday, April 7, 2017 at 3:02:50 PM UTC-4, Walter Lee Davis wrote:Those options are all part of create database, which you would run once, not on every migration. I have usually seen them set at the server level, in the database's ini file.
Walter
> On Apr 7, 2017, at 2:59 PM, fugee ohu <fuge...@gmail.com> wrote:
>
> Trying to get the right syntax for something like this to put in schema.rb for mysql2
>
> ENGINE=InnoDB DEFAULT CHARSET=utf8 PRIMARY KEY=ID AUTOINCREMENT
>
> this isn't valid syntax, anyone can correct? additionally i want id to be int(11) and i want the sql-mode traditional
>
> thanks in advance
>Hey Walter thanks, Until I learn how to set the server can you give me the migrations syntax for each create table statement please, i have something in mind similar to this pseudo-linecreate_table "bios", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 PRIMARY KEY=ID AUTOINCREMENT" do |t|thanks in advanceHere's an idea for you: Run the migration and then look into the db/schema.rb file and compare that to the migration and to the actual database table.It would save time for everyone if you tried some of this yourself and then, if it doesn't make sense, you can say what you did, show the output, explain why you are confused (and what you expected), and then ask for help.-RobFor example:In the migration file:class CreateLanguages < ActiveRecord::Migrationdef changecreate_table :languages do |t|t.string :isot.string :nameendadd_index :languages, :isoendenddb/schema.rbcreate_table "languages", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci" do |t|MySQLt.string "iso"t.string "name"t.index ["iso"], name: "index_languages_on_iso", using: :btreeendmysql> show create table languages\G*************************** 1. row ***************************Table: languagesrcreate_table "artists", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci auto_increment=1" do |t|Create Table: CREATE TABLE `languages` (`id` int(11) NOT NULL AUTO_INCREMENT,`iso` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,PRIMARY KEY (`id`),KEY `index_languages_on_iso` (`iso`)) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci1 row in set (0.00 sec)Here's what I put together so far what where you started me but I still get duplicate entry 0 for primary keycreate_table "artists", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci auto_increment=1" do |t|
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/1e5064c8-a2d6-40c2-9139-98c95fc80fac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment