You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
701 B

  1. <?php
  2. use Movim\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. class DropBundleSessionsTable extends Migration
  5. {
  6. public function up()
  7. {
  8. $this->schema->drop('bundle_sessions');
  9. }
  10. public function down()
  11. {
  12. $this->schema->create('bundle_sessions', function (Blueprint $table) {
  13. $table->increments('id');
  14. $table->integer('bundle_id')->unsigned();
  15. $table->string('deviceid', 64);
  16. $table->foreign('bundle_id')
  17. ->references('id')->on('bundles')
  18. ->onDelete('cascade');
  19. $table->unique(['bundle_id', 'deviceid']);
  20. $table->timestamps();
  21. });
  22. }
  23. }