Skip to content

001_create_tracks.rb

Joe Hellerstein edited this page Dec 8, 2015 · 1 revision

Copy this text into the file db/migrate/001_create_tracks.rb, overwriting what is there.

class CreateTracks < ActiveRecord::Migration
  def self.up
    create_table :tracks do |t|
      # t.column :name :string
      t.column :track_id, :integer
      t.column :name, :string
      t.column :artist, :string
      t.column :album, :string
      t.column :genre, :string
      t.column :kind, :string
      t.column :size, :integer
      t.column :total_time, :integer
      t.column :track_number, :integer
      t.column :track_count, :integer
      t.column :date_modified, :date
      t.column :date_added, :date
      t.column :bit_rate, :integer
      t.column :sample_rate, :integer
      t.column :play_count, :integer
      t.column :play_date, :integer
      t.column :play_date_UTC, :date
      t.column :persistent_id, :string
      t.column :track_type, :string
      t.column :file_type, :integer
      t.column :file_creator, :integer
      t.column :playlist_id, :integer
    end
  end

  def self.down
    drop_table :tracks
  end
end
Clone this wiki locally