2020_10_19_095105_create_yz_subject.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateYzSubject extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. //题目表
  15. if (!Schema::hasTable('yz_subject')) {
  16. Schema::create('yz_subject', function (Blueprint $table) {
  17. $table->increments('id');
  18. $table->integer('uniacid')->nullable()->comment('公众号ID');
  19. $table->string('title')->nullable()->comment('题目');
  20. $table->decimal('uid_reward_value',5,2)->nullable()->comment('会员奖励值设置');
  21. $table->decimal('uid_reward_ratio',5,2)->nullable()->comment('会员奖励比例设置');
  22. $table->decimal('parent_reward_value',5,2)->nullable()->comment('上级奖励值设置');
  23. $table->decimal('parent_reward_ratio',5,2)->nullable()->comment('上级奖励比例设置');
  24. $table->integer('created_at')->nullable();
  25. $table->integer('updated_at')->nullable();
  26. $table->integer('deleted_at')->nullable();
  27. });
  28. \Illuminate\Support\Facades\DB::statement("ALTER TABLE `".app('db')->getTablePrefix()."yz_subject` comment'短视频答题--题目表'");//表注释
  29. }
  30. }
  31. /**
  32. * Reverse the migrations.
  33. *
  34. * @return void
  35. */
  36. public function down()
  37. {
  38. //
  39. }
  40. }