forge->addField([ 'id' => ['type' => 'INT', 'unsigned' => true, 'auto_increment' => true], 'slug' => ['type' => 'VARCHAR', 'constraint' => 160, 'unique' => true], 'title' => ['type' => 'VARCHAR', 'constraint' => 190], 'excerpt' => ['type' => 'VARCHAR', 'constraint' => 320], 'body_md' => ['type' => 'LONGTEXT', 'null' => true], // tools this guide should interlink with (auto "Related tools" block) 'tool_slugs' => ['type' => 'JSON', 'null' => true], 'category_id' => ['type' => 'INT', 'unsigned' => true, 'null' => true], 'seo_title' => ['type' => 'VARCHAR', 'constraint' => 190, 'null' => true], 'seo_description' => ['type' => 'VARCHAR', 'constraint' => 320, 'null' => true], 'reading_minutes' => ['type' => 'INT', 'unsigned' => true, 'default' => 4], 'views' => ['type' => 'BIGINT', 'unsigned' => true, 'default' => 0], 'status' => ['type' => 'ENUM', 'constraint' => ['published', 'draft'], 'default' => 'draft'], 'published_at' => ['type' => 'DATETIME', 'null' => true], 'created_at' => ['type' => 'DATETIME', 'null' => true], 'updated_at' => ['type' => 'DATETIME', 'null' => true], ]); $this->forge->addPrimaryKey('id'); $this->forge->addKey('status'); $this->forge->addKey('published_at'); $this->forge->createTable('guides', true); } public function down(): void { $this->forge->dropTable('guides', true); } }