Merge pull request #468 from shikorism/feature/per-host-resolve-control
リモートホストごとの同時アクセス制御とメタデータ取得ポリシー制御
This commit is contained in:
14
database/factories/ContentProviderFactory.php
Normal file
14
database/factories/ContentProviderFactory.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
|
||||
use App\ContentProvider;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(ContentProvider::class, function (Faker $faker) {
|
||||
return [
|
||||
'host' => 'example.com',
|
||||
'robots' => null,
|
||||
'robots_cached_at' => now(),
|
||||
];
|
||||
});
|
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateContentProvidersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('content_providers', function (Blueprint $table) {
|
||||
$table->string('host');
|
||||
$table->text('robots')->nullable();
|
||||
$table->timestamp('robots_cached_at');
|
||||
$table->boolean('is_blocked')->default(false);
|
||||
$table->integer('access_interval_sec')->default(5);
|
||||
$table->timestamps();
|
||||
|
||||
$table->primary('host');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('content_providers');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user