mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Use AnidbInfo model, update related migration
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
2017-09-04 DariusIII
|
||||
* Chg: Use AnidbInfo model, update related migration
|
||||
* Chg: Rename AnidbEpisodes to AnidbEpisode
|
||||
* Chg: Use AnidbEpisodes model where applicable
|
||||
* Chg: Update and use Genre model, update related migration
|
||||
|
||||
@@ -6,5 +6,42 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AnidbInfo extends Model
|
||||
{
|
||||
//
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $primaryKey = 'anidbid';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $dateFormat = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $incrementing = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'anidbid',
|
||||
'type',
|
||||
'startdate',
|
||||
'enddate',
|
||||
'updated',
|
||||
'related',
|
||||
'similar',
|
||||
'creators',
|
||||
'description',
|
||||
'rating',
|
||||
'picture',
|
||||
'categories',
|
||||
'characters',
|
||||
];
|
||||
}
|
||||
|
||||
+10
-10
@@ -11,16 +11,16 @@ $dotenv->load();
|
||||
$capsule = new Capsule;
|
||||
|
||||
$capsule->addConnection([
|
||||
'driver' => env('DB_SYSTEM'),
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_NAME', 'nntmux'),
|
||||
'username' => env('DB_USER', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8_unicode_ci',
|
||||
'strict' => false,
|
||||
'driver' => env('DB_SYSTEM', 'mysql'),
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_NAME', 'nntmux'),
|
||||
'username' => env('DB_USER', 'root'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8_unicode_ci',
|
||||
'strict' => false,
|
||||
]);
|
||||
|
||||
$capsule->setAsGlobal();
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateAnidbInfoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('anidb_info', function (Blueprint $table) {
|
||||
$table->integer('anidbid', false, true)->comment('ID of title from AniDB');
|
||||
$table->string('type');
|
||||
$table->date('startdate');
|
||||
$table->date('enddate');
|
||||
$table->timestamp('updated');
|
||||
$table->string('related');
|
||||
$table->string('similar');
|
||||
$table->string('creators');
|
||||
$table->text('description');
|
||||
$table->string('rating');
|
||||
$table->string('picture');
|
||||
$table->string('categories');
|
||||
$table->string('characters');
|
||||
$table->index(['startdate', 'enddate', 'updated']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('anidb_info');
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateAnidbInfoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('anidb_info', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('anidb_info');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user