44 lines
1.0 KiB
PHP
44 lines
1.0 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Database\Migrations;
|
||
|
|
|
||
|
|
use CodeIgniter\Database\Migration;
|
||
|
|
|
||
|
|
class UpdatePagesTableForEditorJs extends Migration
|
||
|
|
{
|
||
|
|
public function up()
|
||
|
|
{
|
||
|
|
$fields = [
|
||
|
|
'content_json' => [
|
||
|
|
'type' => 'LONGTEXT',
|
||
|
|
'null' => true,
|
||
|
|
'after' => 'content',
|
||
|
|
],
|
||
|
|
'content_html' => [
|
||
|
|
'type' => 'LONGTEXT',
|
||
|
|
'null' => true,
|
||
|
|
'after' => 'content_json',
|
||
|
|
],
|
||
|
|
'excerpt' => [
|
||
|
|
'type' => 'TEXT',
|
||
|
|
'null' => true,
|
||
|
|
'after' => 'content_html',
|
||
|
|
],
|
||
|
|
'featured_image' => [
|
||
|
|
'type' => 'VARCHAR',
|
||
|
|
'constraint' => 255,
|
||
|
|
'null' => true,
|
||
|
|
'after' => 'excerpt',
|
||
|
|
],
|
||
|
|
];
|
||
|
|
|
||
|
|
$this->forge->addColumn('pages', $fields);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function down()
|
||
|
|
{
|
||
|
|
$this->forge->dropColumn('pages', ['content_json', 'content_html', 'excerpt', 'featured_image']);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|