GermanAirlinesVA-GraphQL/updates/builder_table_create_graphql_keys.php
2021-08-04 00:49:21 +02:00

27 lines
840 B
PHP

<?php namespace GermanAirlinesVa\Graphql\Updates;
use DB;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableCreateGermanAirlinesVaGraphqlGraphqlKeys extends Migration
{
public function up()
{
Schema::connection('germanairlinesva_graphql')->create('graphql_keys', function ($table) {
$table->engine = 'InnoDB';
$table->bigIncrements('id')->unsigned();
$table->bigInteger('member_id')->unsigned();
$table->datetime('valid_from')->default(DB::raw('NOW()'));
$table->string('key');
});
}
public function down()
{
Schema::connection('germanairlinesva_graphql')->disableForeignKeyConstraints();
Schema::connection('germanairlinesva_graphql')->dropIfExists('graphql_keys');
Schema::connection('germanairlinesva_graphql')->enableForeignKeyConstraints();
}
}