/framework/core/session/stationary/migration.tpl

http://zoop.googlecode.com/ · Smarty Template · 28 lines · 26 code · 2 blank · 0 comment · 0 complexity · f991173748e4e2f7f2fa3996f5e5734a MD5 · raw file

  1. <?php
  2. class Migration_[[$version]] extends Migration
  3. {
  4. function up()
  5. {
  6. $sql = "CREATE TABLE session_base
  7. (
  8. session_id text NOT NULL PRIMARY KEY,
  9. last_active timestamp with time zone NOT NULL
  10. )";
  11. SqlAlterSchema($sql);
  12. $sql = "CREATE TABLE session_data
  13. (
  14. session_id text NOT NULL,
  15. key text,
  16. value text,
  17. PRIMARY KEY (session_id, key)
  18. )";
  19. SqlAlterSchema($sql);
  20. }
  21. function down()
  22. {
  23. SqlAlterSchema("DROP TABLE session_data");
  24. SqlAlterSchema("DROP TABLE session_base");
  25. }
  26. }