Gentics Portal.Node PHP API
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
All
Classes
Namespaces
Functions
Variables
Pages
common
migrations
m130301_135042_shoppingcart.php
1
<?php
2
3
class
m130301_135042_shoppingcart
extends
CDbMigration
4
{
5
public
function
up()
6
{
7
$this->createTable(
'{{item}}'
, array(
8
'id'
=>
'pk'
,
9
'price'
=>
'float'
,
10
'admin_email'
=>
'text'
,
11
'page_id'
=>
'integer'
,
12
'title'
=>
'string'
,
13
'item_id'
=>
'integer'
,
14
'order_id'
=>
'integer'
,
15
'quantity'
=>
'integer'
,
16
'referrer'
=>
'string'
,
17
'ip_address'
=>
'string'
,
18
'ordered_at'
=>
'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP'
,
19
));
20
$this->createTable(
'{{order}}'
, array(
21
'id'
=>
'pk'
,
22
'ordered'
=>
'integer DEFAULT 0'
,
23
'user_id'
=>
'integer'
,
24
'shipping_info'
=>
'text'
,
25
'payment_info'
=>
'text'
,
26
'started_at'
=>
'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP'
,
27
));
28
$this->createTable(
'{{tmp_user}}'
, array(
29
'id'
=>
'pk'
,
30
'user_id'
=>
'integer NOT NULL'
,
31
'parent_user_id'
=>
'integer'
,
32
'salutation'
=>
'string NOT NULL'
,
33
'firstname'
=>
'string NOT NULL'
,
34
'lastname'
=>
'string NOT NULL'
,
35
'birthday'
=>
'date'
,
36
'company'
=>
'string'
,
37
'street'
=>
'string NOT NULL'
,
38
'zip_code'
=>
'string NOT NULL'
,
39
'city'
=>
'string NOT NULL'
,
40
'country'
=>
'string NOT NULL'
,
41
'telephone'
=>
'string'
,
42
'email'
=>
'string NOT NULL'
,
43
'memberNo'
=>
'string'
,
44
'svnr'
=>
'string'
,
45
));
46
}
47
48
public
function
down()
49
{
50
$this->dropTable(
'{{Item}}'
);
51
$this->dropTable(
'{{Order}}'
);
52
$this->dropTable(
'{{Tmp_user}}'
);
53
}
54
55
/*
56
// Use safeUp/safeDown to do migration with transaction
57
public function safeUp()
58
{
59
}
60
61
public function safeDown()
62
{
63
}
64
*/
65
}
Generated on Thu Jun 20 2013 14:45:15 for Gentics Portal.Node PHP API by
1.8.1.2