Bez popisu

2015_07_13_111726_add_code_to_programs_table.php 539B

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