hello While I tried SaltedLoginGeneratorQuickstart, I found script/create_db cannot create any tables, because my MySQL is 4.0.23. In Japan, MySQL 4.1 causes many troubles to almost all application which treats Japanese language. So, many users and Linux distributors continue to use 4.0. So, I hope create_db will be able to function for MySQL 4.0. My patch is as follows; /usr/lib/ruby/gems/1.8/gems/db_structure-1.0.2/lib/db_structure.rb - when ''mysql'' - @pk = ''INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY'' - @datetime = ''DATETIME'' - @options = ''ENGINE=InnoDB DEFAULT CHARSET=utf8'' + @client_version ||= ActiveRecord::Base::Mysql.client_version + if @client_version < 40100 + @options = ''ENGINE=InnoDB'' + else + @options = ''ENGINE=InnoDB DEFAULT CHARSET=utf8'' + end ---- http://wiki.rubyonrails.com/rails/show/SaltedLoginGeneratorQuickstart [tk@EDiCube-02 kumalaw]$ ruby script/create_db Recreating database rails_production Database rails_production doesn''t exist yet Table users does not exist Creating tables for rails_production... failed: #<ActiveRecord::StatementInvalid: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''DEFAULT CHARSET=utf8'' at line 18: CREATE TABLE users ( id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, ・・・ delete_after DATETIME default NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8> Take_tk = KUMAGAI Hidetake
take_tk <ggb03124-dTzOdQ2U+/YAvxtiuMwx3w@public.gmane.org> wrote> My patch is as follows; > > /usr/lib/ruby/gems/1.8/gems/db_structure-1.0.2/lib/db_structure.rb > - when ''mysql'' > - @pk = ''INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY'' > - @datetime = ''DATETIME'' > - @options = ''ENGINE=InnoDB DEFAULT CHARSET=utf8'' > + @client_version ||= ActiveRecord::Base::Mysql.client_version > + if @client_version < 40100 > + @options = ''ENGINE=InnoDB'' > + else > + @options = ''ENGINE=InnoDB DEFAULT CHARSET=utf8'' > + endWoo, handmade patch was failed.. /usr/lib/ruby/gems/1.8/gems/db_structure-1.0.2/lib/db_structure.rb when ''mysql'' @pk = ''INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY'' @datetime = ''DATETIME'' - @options = ''ENGINE=InnoDB DEFAULT CHARSET=utf8'' + @client_version ||= ActiveRecord::Base::Mysql.client_version + if @client_version < 40100 + @options = ''ENGINE=InnoDB'' + else + @options = ''ENGINE=InnoDB DEFAULT CHARSET=utf8'' + end Take_tk = KUMAGAI Hidetake たけ(tk)=熊
take_tk wrote:>take_tk <ggb03124-dTzOdQ2U+/YAvxtiuMwx3w@public.gmane.org> wrote > > >>My patch is as follows; >> >> >Woo, handmade patch was failed.. > >Hi, It is best to submit these sort of patches to http://dev.rubyonrails.com/. It might also be good to follow directions there on how to make this patch - it is very easy even for people that don''t know SVN (I''m an Arch person myself, so this would include me :) - Adam>/usr/lib/ruby/gems/1.8/gems/db_structure-1.0.2/lib/db_structure.rb > when ''mysql'' > @pk = ''INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY'' > @datetime = ''DATETIME'' >- @options = ''ENGINE=InnoDB DEFAULT CHARSET=utf8'' >+ @client_version ||= ActiveRecord::Base::Mysql.client_version >+ if @client_version < 40100 >+ @options = ''ENGINE=InnoDB'' >+ else >+ @options = ''ENGINE=InnoDB DEFAULT CHARSET=utf8'' >+ end > >Take_tk = KUMAGAI Hidetake >たけ(tk)=熊 > >