2018_04_05_054639_create_employee_documents_table.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use Illuminate\Database\Schema\Blueprint;
  3. use Illuminate\Database\Migrations\Migration;
  4. class CreateEmployeeDocumentsTable extends Migration
  5. {
  6. /**
  7. * Run the migrations.
  8. *
  9. * @return void
  10. */
  11. public function up()
  12. {
  13. if (!Schema::hasTable('employee_documents')){
  14. Schema::create('employee_documents', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->tinyInteger('document_id');
  17. $table->tinyInteger('employee_id');
  18. $table->string('file',255);
  19. $table->tinyInteger('added_by')->nullable();
  20. $table->tinyInteger('updated_by')->nullable();
  21. $table->tinyInteger('status')->nullable();
  22. $table->tinyInteger('approved_by')->nullable();
  23. $table->softDeletes();
  24. $table->timestamps();
  25. });
  26. }
  27. }
  28. /**
  29. * Reverse the migrations.
  30. *
  31. * @return void
  32. */
  33. public function down()
  34. {
  35. Schema::drop('employee_documents');
  36. }
  37. }