1 <?php
2
3 /*
4 * This file is part of the Icybee package.
5 *
6 * (c) Olivier Laviale <olivier.laviale@gmail.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Icybee\Modules\Comments;
13
14 /**
15 * - Renames the `created` columns as `created_as`.
16 * - Creates the `updated_at` column.
17 *
18 * @module comments
19 */
20 class Update20131208 extends \ICanBoogie\Updater\Update
21 {
22 public function update_column_created_at()
23 {
24 $this->module->model
25 ->assert_has_column('created')
26 ->rename_column('created', 'created_at');
27 }
28
29 public function update_column_updated_at()
30 {
31 $this->module->model
32 ->assert_not_has_column('updated_at')
33 ->create_column('updated_at');
34 }
35 }