This commit is contained in:
nelsonlaquet 2013-08-01 12:35:16 -05:00
parent e6143f7c06
commit 6f392bed02
2 changed files with 6 additions and 7 deletions

View file

@ -136,21 +136,20 @@ class MigrateOldData extends Command {
'slug' => $playlist->slug, 'slug' => $playlist->slug,
'id' => $playlist->id, 'id' => $playlist->id,
'user_id' => $playlist->user_id, 'user_id' => $playlist->user_id,
'is_pinned' => true,
'is_public' => true 'is_public' => true
]); ]);
} }
$this->info('Syncing Playlist Tracks'); $this->info('Syncing Playlist Tracks');
$oldPlaylistTracks = $oldDb->table('playlist_tracks'); $oldPlaylistTracks = $oldDb->table('playlist_track');
foreach ($oldPlaylistTracks as $playlistTrack) { foreach ($oldPlaylistTracks as $playlistTrack) {
DB::table('playlist_tracks')->insert([ DB::table('playlist_tracks')->insert([
'id' => $playlistTrack['id'], 'id' => $playlistTrack['id'],
'created_at' => $playlistTrack['created_at'], 'created_at' => $playlistTrack->created_at,
'updated_at' => $playlistTrack['updated_at'], 'updated_at' => $playlistTrack->updated_at,
'position' => $playlistTrack['position'], 'position' => $playlistTrack->position,
'playlist_id' => $playlistTrack['playlist_id'], 'playlist_id' => $playlistTrack->playlist_id,
'track_id' => $playlistTrack['track_id'] 'track_id' => $playlistTrack->track_id
]); ]);
} }