migration.php 739 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. class Create_Session_Table {
  3. /**
  4. * Make changes to the database.
  5. *
  6. * @return void
  7. */
  8. public function up()
  9. {
  10. Schema::table(Config::get('session.table'), function($table)
  11. {
  12. $table->create();
  13. // The session table consists simply of an ID, a UNIX timestamp to
  14. // indicate the expiration time, and a blob field which will hold
  15. // the serialized form of the session payload.
  16. $table->string('id')->length(40)->primary('session_primary');
  17. $table->integer('last_activity');
  18. $table->text('data');
  19. });
  20. }
  21. /**
  22. * Revert the changes to the database.
  23. *
  24. * @return void
  25. */
  26. public function down()
  27. {
  28. Schema::table(Config::get('session.table'), function($table)
  29. {
  30. $table->drop();
  31. });
  32. }
  33. }