2022_01_19_025041_create_custom_emoji_table.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateCustomEmojiTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('custom_emoji', function (Blueprint $table) {
  15. $table->id();
  16. $table->string('shortcode')->index();
  17. $table->string('media_path')->nullable();
  18. $table->string('domain')->nullable()->index();
  19. $table->boolean('disabled')->default(false)->index();
  20. $table->string('uri')->nullable();
  21. $table->string('image_remote_url')->nullable();
  22. $table->unsignedInteger('category_id')->nullable();
  23. $table->unique(['shortcode', 'domain']);
  24. $table->timestamps();
  25. });
  26. Schema::create('custom_emoji_categories', function (Blueprint $table) {
  27. $table->id();
  28. $table->string('name')->unique()->index();
  29. $table->boolean('disabled')->default(false)->index();
  30. $table->timestamps();
  31. });
  32. }
  33. /**
  34. * Reverse the migrations.
  35. *
  36. * @return void
  37. */
  38. public function down()
  39. {
  40. Schema::dropIfExists('custom_emoji');
  41. Schema::dropIfExists('custom_emoji_categories');
  42. }
  43. }