38 lines
848 B
PHP
38 lines
848 B
PHP
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class UpdateNewsTableForEditorJs 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',
|
|
],
|
|
];
|
|
|
|
$this->forge->addColumn('news', $fields);
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
$this->forge->dropColumn('news', ['content_json', 'content_html', 'excerpt']);
|
|
}
|
|
}
|
|
|