class CreateTables < ActiveRecord::Migration def self.up create_table "users", :force => true 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 :login_allowed, :boolean, :default => false end User.create :login => 'admin', :password => 'password', :password_confirmation => 'password', :email => 'me@change_this_email.com' create_table :programs do |t| t.column :title, :string t.column :description, :text t.column :asset_url, :string t.column :link, :string t.column :language, :string t.column :author, :string end Program.create :title => "Podcast", :description => "Please edit the description for this program.", :link => "http://podcast.rubyonrails.org", :language => "en-us", :author => "Geoffrey Grosenbach" create_table :episodes do |t| t.column :program_id, :integer, :default => 1 t.column :title, :string t.column :description, :text t.column :permalink, :string t.column :published_at, :datetime t.column :updated_at, :datetime t.column :has_mp3, :boolean, :default => true t.column :mp3_url, :string t.column :mp3_length, :integer t.column :has_mp4, :boolean, :default => false t.column :mp4_url, :string t.column :mp4_length, :integer t.column :has_transcript, :boolean, :default => false t.column :transcript_url, :string t.column :transcript_published_at, :datetime t.column :transcript, :text end create_table :hosts do |t| t.column :user_id, :integer t.column :episode_id, :integer t.column :position, :integer end end def self.down drop_table :users drop_table :episodes drop_table :programs drop_table :hosts end end