PageRenderTime 14ms CodeModel.GetById 8ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 2class 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		
13		$sql = "CREATE TABLE session_data
14				(
15					session_id text NOT NULL,
16					key text,
17					value text,
18					PRIMARY KEY (session_id, key)
19				)";
20		SqlAlterSchema($sql);
21	}
22	
23	function down()
24	{
25		SqlAlterSchema("DROP TABLE session_data");
26		SqlAlterSchema("DROP TABLE session_base");
27	}
28}