Session Problem plz help me

first i create the model on the pre-build table product ( i do not
migrate product table it is already in the database) , after that i
create the session migrate file ,
class Sessions < ActiveRecord::Migration
def self.up
create_table :sessions do |t|
t.column :session_id, :string
t.column :data, :text
t.column :updated_at, :datetime
end

add_index :sessions, :session_id
add_index :sessions, :updated_at

end

def self.down
drop_table :sessions
end
end
.
but it gives me the error
\NetBeansProjects\project1\db\migrate\002_sessions.rb:1: uninitialized
constant ActiveRecord (NameError)

can any one tell me what is the problem

Suhaib Absar wrote:

but it gives me the error
\NetBeansProjects\project1\db\migrate\002_sessions.rb:1: uninitialized
constant ActiveRecord (NameError)

can any one tell me what is the problem

It looks like you tried to run the migration as a ruby script. Instead,
just run the following in your project directory (project1):

rake db:migrate

This causes any outstanding migrations to be run against the database.