Favorite and playlist models

This commit is contained in:
magnolia-fan
2011-06-22 04:05:12 +04:00
parent 9531230f6e
commit 9558f720ca
13 changed files with 143 additions and 0 deletions
@@ -0,0 +1,16 @@
class CreateFavorites < ActiveRecord::Migration
def self.up
create_table :favorites do |t|
t.integer :user_id
t.integer :artist_id
t.integer :album_id
t.integer :track_id
t.timestamps
end
end
def self.down
drop_table :favorites
end
end
@@ -0,0 +1,14 @@
class CreatePlaylists < ActiveRecord::Migration
def self.up
create_table :playlists do |t|
t.integer :user_id
t.string :name
t.timestamps
end
end
def self.down
drop_table :playlists
end
end
@@ -0,0 +1,14 @@
class CreatePlaylistItems < ActiveRecord::Migration
def self.up
create_table :playlist_items do |t|
t.integer :playlist_id
t.integer :track_id
t.timestamps
end
end
def self.down
drop_table :playlist_items
end
end