Favorite and playlist models
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user