Files
safekat/ci4/app/Database/Migrations/2024-09-17-151435_ChatDepartments.php
2024-09-17 23:11:35 +02:00

35 lines
706 B
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class ChatDepartments extends Migration
{
protected array $COLUMNS = [
"id" => [
"type" => "INT",
"unsigned" => true,
"autoincrement" => true
],
"name" => [
"type" => "VARCHAR",
"constraint" => '45',
"unique" => true,
],
];
public function up()
{
$this->forge->addField($this->COLUMNS);
$this->forge->createTable("chat_departments");
$this->forge->addPrimaryKey('id');
}
public function down()
{
//
$this->forge->dropTable("chat_departments");
}
}