1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Icybee\Modules\Contents;
13
14 use ICanBoogie\Updater\Update;
15 use ICanBoogie\Updater\AssertionFailed;
16
17 18 19 20 21
22 class Update20140330 extends Update
23 {
24 public function update_rename_model_cache_as_rendered()
25 {
26 $connection = $this->app->connections['local'];
27
28 if ($connection->table_exists('contents__rendered'))
29 {
30 throw new AssertionFailed(__FUNCTION__, []);
31 }
32
33 $connection->exec('CREATE TABLE contents__rendered AS SELECT `nid`, `timestamp` AS `updated_at`, `body` FROM contents__cache');
34 $connection->exec('DROP TABLE contents__cache');
35 }
36 }