Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
m130225_142114_fg.php
1 <?php
2 
3 class m130225_142114_fg extends CDbMigration
4 {
5  /*public function up()
6  {
7  }
8 
9  public function down()
10  {
11  echo "m130225_142114_fg does not support migration down.\n";
12  return false;
13  }*/
14 
15 
16  // Use safeUp/safeDown to do migration with transaction
17  public function safeUp()
18  {
19  $this->createTable('{{formdata}}', array(
20  'id' => 'pk',
21  'form_id' => 'integer NOT NULL',
22  'created_at' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
23  'referer' => 'string NOT NULL DEFAULT \'\'',
24  'ip' => 'string NOT NULL DEFAULT \'\'',
25  'json' => 'text NOT NULL'
26  ));
27  $this->createTable('{{forms}}', array(
28  'id' => 'pk',
29  'name' => 'string NOT NULL DEFAULT \'\'',
30  'json' => 'text',
31  'html' => 'text',
32  'creator_email' => 'string NOT NULL DEFAULT \'\'',
33  'user' => 'string NOT NULL DEFAULT \'\'',
34  'salt' => 'string DEFAULT \'\''
35  ));
36  $this->createTable('{{templates}}', array(
37  'id' => 'pk',
38  'name' => 'string NOT NULL DEFAULT \'\'',
39  'json' => 'text',
40  'user' => 'string NOT NULL DEFAULT \'\'',
41  'global' => 'bool NOT NULL DEFAULT FALSE',
42  ));
43  }
44 
45  public function safeDown()
46  {
47  $this->dropTable('{{formdata}}');
48  $this->dropTable('{{forms}}');
49  $this->dropTable('{{templates}}');
50  }
51 
52 }