Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
m120411_124544_comments.php
1 <?php
2 /**
3  * Gentics Portal.Node PHP
4  * Author & Copyright (c) by Gentics Software GmbH
5  * sales@gentics.com
6  * http://www.gentics.com
7  * Licenses can be found in the LICENSE.txt file in the root-folder of this installation
8  * You must not use this software without a valid license agreement.
9  */
10 class m120411_124544_comments extends CDbMigration
11 {
12  public function safeUp()
13  {
14  $this->createTable('{{comments}}', array(
15  'id' => 'pk',
16  'parent_id' => 'integer',
17  'content_id' => 'string NOT NULL',
18  'user_id' => 'integer',
19  'moderator_email' => 'string',
20  'firstname' => 'string',
21  'lastname' => 'string',
22  'email' => 'string NOT NULL',
23  'subject' => 'string NOT NULL',
24  'description' => 'text NOT NULL',
25  'notify_moderator' => "bool NOT NULL DEFAULT FALSE",
26  'notify_user' => "bool NOT NULL DEFAULT FALSE",
27  'status' => "integer NOT NULL DEFAULT 0",
28  'language' => 'string NOT NULL',
29  'createtime' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP',
30  ));
31  $this->createIndex('comments_content_id_idx', '{{comments}}', 'content_id');
32  $this->createIndex('comments_user_id_idx', '{{comments}}', 'user_id');
33  $this->createIndex('comments_parent_id_idx', '{{comments}}', 'parent_id');
34  $this->createIndex('comments_status_idx', '{{comments}}', 'status');
35 
36  }
37 
38  public function safeDown()
39  {
40  $this->dropTable('{{comments}}');
41  }
42 
43 }