CreateComplexOrdersTable.txt 551 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. class CreateOrdersTable extends Migration {
  5. /**
  6. * Run the migrations.
  7. *
  8. * @return void
  9. */
  10. public function up()
  11. {
  12. Schema::create('orders', function(Blueprint $table)
  13. {
  14. $table->increments('id');
  15. $table->string('title', 50)->unique();
  16. $table->text('body')->unique()->nullable();
  17. $table->timestamps();
  18. });
  19. }
  20. /**
  21. * Reverse the migrations.
  22. *
  23. * @return void
  24. */
  25. public function down()
  26. {
  27. Schema::drop('orders');
  28. }
  29. }