2019_03_18_092742_create_settings_table.php 892 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. use App\Setting;
  6. class CreateSettingsTable extends Migration
  7. {
  8. /**
  9. * Run the migrations.
  10. *
  11. * @return void
  12. */
  13. public function up()
  14. {
  15. Schema::create('settings', function (Blueprint $table) {
  16. $table->string('key', 40)->index()->unique();
  17. $table->mediumText('value')->nullable();
  18. $table->boolean('serialized')->default(0);
  19. });
  20. $entety = new Setting();
  21. $entety->key = 'url_callback_bot';
  22. $entety->value = 'http://localhost/tbot';
  23. $entety->serialized = 0;
  24. $entety->save();
  25. }
  26. /**
  27. * Reverse the migrations.
  28. *
  29. * @return void
  30. */
  31. public function down()
  32. {
  33. Schema::dropIfExists('settings');
  34. }
  35. }