PageRenderTime 32ms CodeModel.GetById 26ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/apps/request/migrations/2_sessions.php

http://zoop.googlecode.com/
PHP | 28 lines | 26 code | 2 blank | 0 comment | 0 complexity | cd437dc74a97307a5b0dfdda26c1e2fc MD5 | raw file
 1<?php
 2class Migration_2 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}