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