Nav apraksta

2016_03_11_085258_add_school_and_concentration_codes_to_students_table.php 667B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. class AddSchoolAndConcentrationCodesToStudentsTable extends Migration {
  5. /**
  6. * Run the migrations.
  7. *
  8. * @return void
  9. */
  10. public function up()
  11. {
  12. Schema::table('students', function(Blueprint $table)
  13. {
  14. $table->char('school_code', 2)->after('name')->nullable();
  15. $table->char('conc_code', 4)->after('school_code')->nullable();
  16. });
  17. }
  18. /**
  19. * Reverse the migrations.
  20. *
  21. * @return void
  22. */
  23. public function down()
  24. {
  25. Schema::table('students', function(Blueprint $table)
  26. {
  27. $table->dropColumn(array('school_code', 'conc_code'));
  28. });
  29. }
  30. }