castopod/app/Database/Migrations/2020-08-17-150000_add_pages.php
Yassine Doghri bb4752c35e feat(comments): add comments to episodes + update naming of status to post
- remove confusing counts for episode (total favourites, total reblogs)
- add comments section to
episode page to display episode comments + post replies linked to the episode
2021-12-29 11:54:22 +00:00

62 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
/**
* Class AddPages Creates pages table in database
*
* @copyright 2020 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AddPages extends Migration
{
public function up(): void
{
$this->forge->addField([
'id' => [
'type' => 'INT',
'unsigned' => true,
'auto_increment' => true,
],
'title' => [
'type' => 'VARCHAR',
'constraint' => 255,
],
'slug' => [
'type' => 'VARCHAR',
'constraint' => 128,
'unique' => true,
],
'content_markdown' => [
'type' => 'TEXT',
],
'content_html' => [
'type' => 'TEXT',
],
'created_at' => [
'type' => 'DATETIME',
],
'updated_at' => [
'type' => 'DATETIME',
],
'deleted_at' => [
'type' => 'DATETIME',
'null' => true,
],
]);
$this->forge->addPrimaryKey('id');
$this->forge->createTable('pages');
}
public function down(): void
{
$this->forge->dropTable('pages');
}
}