Skip to content

Instantly share code, notes, and snippets.

@wjlafrance
Created December 18, 2011 00:52
Show Gist options
  • Save wjlafrance/1491983 to your computer and use it in GitHub Desktop.
Save wjlafrance/1491983 to your computer and use it in GitHub Desktop.
class CreateBookmarksAndUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :username
t.string :password
t.string :email_address
t.timestamps
end
create_table :bookmarks do |t|
t.string :name
t.string :url
t.timestamps
end
create_table :bookmarks_users, :id => false do |t|
t.integer :user_id
t.integer :bookmark_id
end
end
def self.down
drop_table :users
drop_table :bookmarks
drop_table :bookmarks_users
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment