12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- use Illuminate\Support\Facades\Schema;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
- use App\Setting;
- class CreateSettingsTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('settings', function (Blueprint $table) {
- $table->string('key', 40)->index()->unique();
- $table->mediumText('value')->nullable();
- $table->boolean('serialized')->default(0);
- });
- $entety = new Setting();
- $entety->key = 'url_callback_bot';
- $entety->value = 'http://localhost/tbot';
- $entety->serialized = 0;
- $entety->save();
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('settings');
- }
- }
|