Skip to content

Commit

Permalink
Publish migration
Browse files Browse the repository at this point in the history
  • Loading branch information
hsyir committed Sep 4, 2020
1 parent 10923f8 commit eef8823
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
35 changes: 35 additions & 0 deletions database/2019_12_30_054039_create_options_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOptionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('options', function (Blueprint $table) {
$table->string('key')->primary();
$table->string('title')->nullable();
$table->text('value')->nullable();
$table->string('comment')->nullable();
$table->timestamps();

});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('options');
}
}
6 changes: 5 additions & 1 deletion src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@ public function register()
public function boot()
{
$this->publishes([__DIR__ . '/../config/options.php' => config_path('options.php'),], 'config');
}

$this->publishes([
__DIR__.'/../database/' => database_path('migrations')
], 'migrations');
}
}

0 comments on commit eef8823

Please sign in to comment.