Hi, I am following a tutorial using the acts_as_authenticated plugin. I created a new project and created a controller today and then installed the authentication plugin. I ran the rake db:migrate. == CreateUsers: migrating ====================================================-- create_table("users") rake aborted! Mysql::Error: 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 ''datatime DEFAULT NULL) ENGINE=InnoDB'' at line 1: CREATE TABLE users (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `login` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `crypted_password` varchar(40) DEFAULT NULL, `salt` varchar(40) DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` datetime DEFAULT NULL, `remember_token` varchar(255) DEFAULT NULL, `remember_token_expires_at` datetime DEFAULT NULL, `activation_code` varchar(40) DEFAULT NULL, `activated_at` datatime DEFAULT NULL) ENGINE=InnoDB (See full trace by running task with --trace) My migration file is: def self.up create_table "users" do |t| t.column :login, :string t.column :email, :string t.column :crypted_password, :string, :limit => 40 t.column :salt, :string, :limit => 40 t.column :created_at, :datetime t.column :updated_at, :datetime t.column :remember_token, :string t.column :remember_token_expires_at, :datetime t.column :activation_code, :string, :limit => 40 t.column :activated_at, :datatime end end There is no column with id as rails already creates one. Please help me in this issue. I am using rails 1.2.6 with MYSQL 5.2.0 beta on a Mac OSX tiger. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 26/01/2008, stranger <strangersquest-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I am following a tutorial using the acts_as_authenticated plugin. I > created a new project and created a controller today and then > installed the authentication plugin. I ran the rake db:migrate. > > > == CreateUsers: migrating > ====================================================> -- create_table("users") > rake aborted! > Mysql::Error: 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 ''datatime DEFAULT NULL) ENGINE=InnoDB'' at line 1: CREATE > TABLE users (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, > `login` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, > `crypted_password` varchar(40) DEFAULT NULL, `salt` varchar(40) > DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at` > datetime DEFAULT NULL, `remember_token` varchar(255) DEFAULT NULL, > `remember_token_expires_at` datetime DEFAULT NULL, `activation_code` > varchar(40) DEFAULT NULL, `activated_at` datatime DEFAULT NULL) > ENGINE=InnoDB > > (See full trace by running task with --trace) > > My migration file is: > > def self.up > create_table "users" do |t| > t.column :login, :string > t.column :email, :string > t.column :crypted_password, :string, :limit => 40 > t.column :salt, :string, :limit => 40 > t.column :created_at, :datetime > t.column :updated_at, :datetime > t.column :remember_token, :string > t.column :remember_token_expires_at, :datetime > t.column :activation_code, :string, :limit => 40 > t.column :activated_at, :datatime > end > end > > There is no column with id as rails already creates one. Please help > me in this issue. I am using rails 1.2.6 with MYSQL 5.2.0 beta on a > Mac OSX tiger.try use restful_authentication plugin instead http://agilewebdevelopment.com/plugins/restful_authentication http://railscasts.com/episodes/67 i''m wondering also why you use that old migration from that old plugin where you can now do sexy automatic migration like t.timestamps for created_at and updated_at fields from new plugin (same plugin author/technoweenie)> > >-- r9 = { name: Rie!, ym: riyari3, skype: rubyninja, li: http://linkedin.com/in/ariekeren, fb: http://profile.to/ariekeren, blog: http://tinyurl.com/2bjgvn } --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 26 Jan 2008, at 07:19, stranger wrote:> > Hi, > > I am following a tutorial using the acts_as_authenticated plugin. I > created a new project and created a controller today and then > installed the authentication plugin. I ran the rake db:migrate. > t.column :activated_at, :datatimeShould of course be :datetime :-) Fred> end > end > > There is no column with id as rails already creates one. Please help > me in this issue. I am using rails 1.2.6 with MYSQL 5.2.0 beta on a > Mac OSX tiger. > > > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you for the reply.... I was just following the book. The migration ran smoothly for Sqlite3 database, but the problem still exists for the mysql database.... I dont understand why???? On Jan 26, 4:23 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 26 Jan 2008, at 07:19, stranger wrote: > > > > > Hi, > > > I am following a tutorial using the acts_as_authenticated plugin. I > > created a new project and created a controller today and then > > installed the authentication plugin. I ran the rake db:migrate. > > t.column :activated_at, :datatime > > Should of course be :datetime :-) > > Fred > > > end > > end > > > There is no column with id as rails already creates one. Please help > > me in this issue. I am using rails 1.2.6 with MYSQL 5.2.0 beta on a > > Mac OSX tiger.--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---