RententionBookChapterUV.php 860 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Modules\Book\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Schema\Blueprint;
  5. use Illuminate\Support\Facades\Schema;
  6. class RententionBookChapterUV extends Model
  7. {
  8. protected $table = 'rentention_book_chapter_uvs';
  9. protected $fillable = [
  10. 'bid',
  11. 'sequence',
  12. 'uv',
  13. ];
  14. public static function createTable()
  15. {
  16. if (!Schema::hasTable('rentention_book_chapter_uvs')) {
  17. Schema::create('rentention_book_chapter_uvs', function (Blueprint $table) {
  18. $table->increments('id');
  19. $table->integer('bid');
  20. $table->integer('sequence');
  21. $table->integer('uv');
  22. $table->timestamps();
  23. $table->index(['bid', 'sequence'], 'idx_bid_sequence');
  24. });
  25. }
  26. }
  27. }