2019_09_05_094541_create_table_notice_rule.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateTableNoticeRule extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('notice_rule', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->string('title', 32)
  17. ->default('')
  18. ->comment('标题');
  19. $table->string('content', 500)
  20. ->default('')
  21. ->comment('内容');
  22. $table->tinyInteger('notice_status')
  23. ->default(0)
  24. ->comment('通知状态:0:未发送,1发送中,2已发送');
  25. $table->tinyInteger('notice_type')
  26. ->default(0)
  27. ->comment('通知类型:0push,1短信');
  28. $table->tinyInteger('notice_user_type')
  29. ->default(0)
  30. ->comment('通知用户类型:0全部,1条件筛选,2ID群发');
  31. $table->json('notice_users')
  32. ->nullable()
  33. ->comment('通知用户:attribute,category,ids');
  34. $table->string('action_type', 16)
  35. ->default('')
  36. ->comment('跳转内容');
  37. $table->integer('action_id')
  38. ->default(0)
  39. ->comment('跳转id');
  40. $table->string('post_type', 16)
  41. ->default('')
  42. ->comment('内容类型');
  43. $table->string('cover', 255)
  44. ->default('')
  45. ->comment('封面图');
  46. $table->integer('send_count')
  47. ->default(0)
  48. ->comment('发送数量');
  49. $table->dateTime('send_time')
  50. ->nullable()
  51. ->comment('发送时间');
  52. $table->softDeletes();
  53. $table->timestamps();
  54. });
  55. }
  56. /**
  57. * Reverse the migrations.
  58. *
  59. * @return void
  60. */
  61. public function down()
  62. {
  63. Schema::dropIfExists('notice_rule');
  64. }
  65. }