Files
monica/database/migrations/2018_06_10_221746_migrate_entries_objects.php
T
Régis FreydandGitHub 29197090a7 Restructure where models are stored (#1476)
The idea is to clean the repository a little bit by moving models into their respective folders.
2018-06-14 20:49:12 -04:00

28 lines
742 B
PHP

<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Migrations\Migration;
class MigrateEntriesObjects extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::table('journal_entries')
->where('journalable_type', 'App\Activity')
->update(['journalable_type' => 'App\Models\Contact\Activity']);
DB::table('journal_entries')
->where('journalable_type', 'App\Day')
->update(['journalable_type' => 'App\Models\Journal\Day']);
DB::table('journal_entries')
->where('journalable_type', 'App\Entry')
->update(['journalable_type' => 'App\Models\Journal\Entry']);
}
}