Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. <?php
  2.  
  3. public function up()
  4. {
  5. Schema::create('categories', function (Blueprint $table){
  6.  
  7. $table->increments('id');
  8. $table->string('slug')->nullable();
  9. $table->string('old_redirect')->nullable();
  10. $table->string('name')->nullable();
  11. $table->string('short_desc')->nullable();
  12. $table->text('full_desc')->nullable();
  13. $table->string('img_sm')->nullable();
  14. $table->string('img_md')->nullable();
  15. $table->string('img_lg')->nullable();
  16. $table->unsignedTinyInteger('priority');
  17. $table->unsignedTinyInteger('type');
  18. $table->boolean('active')->default(true);
  19. $table->timestamps();
  20.  
  21. NestedSet::columns($table);
  22.  
  23. $table->unique(['parent_id', 'slug']);
  24.  
  25. });
  26.  
  27. }
  28.  
  29. public function down()
  30. {
  31. Schema::table('categories', function (Blueprint $table) {
  32. NestedSet::dropColumns($table);
  33. });
  34. Schema::dropIfExists('categories');
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement