rake aborted.. Mysql error

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

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)

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 :slight_smile:

Fred

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???