mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-27 04:32:14 +00:00
![Dan Brown](/assets/img/avatar_default.png)
To allow easy temporary de-activation without deletion or other workarounds. Updated tests to cover.
49 lines
1.1 KiB
PHP
49 lines
1.1 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateWebhooksTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('webhooks', function (Blueprint $table) {
|
|
$table->increments('id');
|
|
$table->string('name', 150);
|
|
$table->boolean('active');
|
|
$table->string('endpoint', 500);
|
|
$table->timestamps();
|
|
|
|
$table->index('name');
|
|
$table->index('active');
|
|
});
|
|
|
|
Schema::create('webhook_tracked_events', function (Blueprint $table) {
|
|
$table->increments('id');
|
|
$table->integer('webhook_id');
|
|
$table->string('event', 50);
|
|
$table->timestamps();
|
|
|
|
$table->index('event');
|
|
$table->index('webhook_id');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('webhooks');
|
|
Schema::dropIfExists('webhook_tracked_events');
|
|
}
|
|
}
|