Remove all references to daemon keys from the codebase

This commit is contained in:
Dane Everitt 2020-09-13 11:38:42 -07:00
parent 4dddcaebb0
commit 703f55271d
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
13 changed files with 43 additions and 529 deletions

View file

@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class DropDaemonKeyTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('daemon_keys');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::create('daemon_keys', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('server_id');
$table->unsignedInteger('user_id');
$table->string('secret')->unique();
$table->timestamp('expires_at');
$table->timestamps();
});
Schema::table('daemon_keys', function (Blueprint $table) {
$table->foreign('server_id')->references('id')->on('servers')->cascadeOnDelete();
$table->foreign('user_id')->references('id')->on('users')->cascadeOnDelete();
});
}
}