1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-14 22:22:39 +01:00

fix recent sort of tv shows

This commit is contained in:
devfake 2016-11-29 12:06:36 +01:00
parent 79241ff1f9
commit 200aca29de
3 changed files with 34 additions and 0 deletions

View File

@ -16,5 +16,6 @@
'episode_tmdb_id',
'seen',
'season_tmdb_id',
'created_at'
];
}

View File

@ -193,6 +193,7 @@
$new->episode_number = $episode->episode_number;
$new->name = $episode->name;
$new->tmdb_id = $tmdbId;
$new->created_at = time();
$new->save();
}
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddCreatedAtField extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('episodes', function (Blueprint $table) {
$table->integer('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('episodes', function (Blueprint $table) {
$table->dropColumn('created_at');
});
}
}