2020_03_25_134142_privillage.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class Privillage extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('roles', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->string('role_name',100);
  17. $table->string('description',255);
  18. $table->string('akses',20);
  19. $table->timestamps();
  20. });
  21. Schema::create('role_acl', function (Blueprint $table) {
  22. $table->increments('id');
  23. $table->unsignedInteger('role_id')->nullable();
  24. $table->string('module_id')->nullable();
  25. $table->string('create_acl')->nullable();
  26. $table->string('read_acl')->nullable();
  27. $table->string('update_acl')->nullable();
  28. $table->string('delete_acl')->nullable();
  29. $table->integer('module_parent');
  30. $table->timestamps();
  31. });
  32. Schema::create('modules', function (Blueprint $table) {
  33. $table->increments('id');
  34. $table->integer('menu_parent')->nullable();
  35. $table->string('module_name');
  36. $table->string('menu_mask');
  37. $table->string('menu_path');
  38. $table->string('menu_icon')->nullable();
  39. $table->integer('menu_order')->nullable();
  40. $table->integer('divider')->nullable();
  41. $table->string('pathParent');
  42. $table->string('kdModule');
  43. $table->timestamps();
  44. });
  45. Schema::table('users', function (Blueprint $table) {
  46. $table->unsignedInteger('role_id');
  47. });
  48. }
  49. /**
  50. * Reverse the migrations.
  51. *
  52. * @return void
  53. */
  54. public function down()
  55. {
  56. //
  57. }
  58. }