mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
add people & characters migrations
This commit is contained in:
parent
72f7191512
commit
022879aa02
@ -8,7 +8,7 @@ class CreateIndex extends Migration
|
||||
{
|
||||
|
||||
const IGNORE = [
|
||||
'anime', 'manga'
|
||||
'anime', 'manga', 'people', 'characters'
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePeopleTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('people', function (Blueprint $table) {
|
||||
$table->unique(['request_hash' => 1], 'request_hash');
|
||||
$table->unique(['mal_id' => 1], 'mal_id');
|
||||
$table->string('url');
|
||||
$table->string('image_url');
|
||||
$table->string('website_url');
|
||||
$table->index('name');
|
||||
$table->string('given_name')->index()->nullable();
|
||||
$table->string('family_name')->index()->nullable();
|
||||
$table->date('birthday');
|
||||
$table->integer('member_favorites')->index('member_favorites');
|
||||
$table->string('about')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('people');
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateCharactersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('characters', function (Blueprint $table) {
|
||||
$table->unique(['request_hash' => 1], 'request_hash');
|
||||
$table->unique(['mal_id' => 1], 'mal_id');
|
||||
$table->string('url');
|
||||
$table->string('image_url');
|
||||
$table->index('name');
|
||||
$table->index('name_kanji');
|
||||
$table->integer('popularity')->index('popularity');
|
||||
$table->integer('members')->index('members');
|
||||
$table->integer('member_favorites')->index('member_favorites');
|
||||
$table->string('about')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('characters');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user