Message board help

Im trying to do the message board tutorial here but I have rain into a
problem

I get this error message

SQLite3::SQLException: table posts already exists: CREATE TABLE posts
(“id” INTE
GER PRIMARY KEY AUTOINCREMENT NOT NULL, “body” text DEFAULT NULL,
“created_at” d
atetime NOT NULL, “name” varchar(100) DEFAULT NULL, “discussion_id”
integer NOT
NULL)

when I try to migrate this bit of code

class CreatePostsTable < ActiveRecord::Migration
def self.up
create_table :posts do |table|
table.column :body, :text
table.column :created_at, :datetime, :null => false
table.column :name, :string, :limit=>100
table.column :discussion_id, :integer, :null => false
end
execute “ALTER TABLE posts ADD CONSTRAINT fk_posts
FOREIGN KEY(discussion_id) REFERENCES discussions(id)”
end
def self.down
drop_table :posts
end
end

can anyone help me?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs