first commit

This commit is contained in:
root
2026-01-10 16:16:39 +03:00
commit 5f5a28e292
154 changed files with 21454 additions and 0 deletions
@@ -0,0 +1,64 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateOrganizationsClientsTable extends Migration
{
public function up()
{
$this->forge->addField([
'id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'auto_increment' => true,
],
'organization_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
],
'name' => [
'type' => 'VARCHAR',
'constraint' => 255,
],
'email' => [
'type' => 'VARCHAR',
'constraint' => 255,
'null' => true,
],
'phone' => [
'type' => 'VARCHAR',
'constraint' => 50,
'null' => true,
],
'notes' => [
'type' => 'TEXT',
'null' => true,
],
'created_at' => [
'type' => 'DATETIME',
'null' => true,
],
'updated_at' => [
'type' => 'DATETIME',
'null' => true,
],
'deleted_at' => [
'type' => 'DATETIME',
'null' => true,
],
]);
$this->forge->addKey('id', true);
$this->forge->addKey('organization_id');
$this->forge->addForeignKey('organization_id', 'organizations', 'id', 'CASCADE', 'CASCADE');
$this->forge->createTable('organizations_clients');
}
public function down()
{
$this->forge->dropTable('organizations_clients');
}
}