-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupdates.php
More file actions
48 lines (41 loc) · 921 Bytes
/
updates.php
File metadata and controls
48 lines (41 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace Icybee\Modules\Forms;
use ICanBoogie\Updater\AssertionFailed;
use ICanBoogie\Updater\Update;
/**
* - Rename table `feedback_forms` as `forms`.
*
* @module forms
*/
class Update20120101 extends Update
{
public function update_table_forms()
{
$db = $this->app->db;
if (!$db->table_exists('feedback_forms'))
{
throw new AssertionFailed('assert_table_exists', 'feedback_forms');
}
$db("RENAME TABLE `{prefix}feedback_forms` TO `{prefix}forms`");
}
public function update_constructor_type()
{
$db = $this->app->db;
$db("UPDATE `{prefix}nodes` SET constructor = 'forms' WHERE constructor = 'feedback.forms'");
}
}
/**
* @module forms
*/
class Update2015090821 extends Update
{
/**
* Renames column `pageid` as `page_id`.
*/
public function update_column_page_id()
{
$this->module->model
->assert_has_column('pageid')
->rename_column('pageid', 'page_id');
}
}