|
Server : Apache System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : matalashes ( 1004) PHP Version : 8.1.29 Disable Function : NONE Directory : /home/matalashes/.trash/app.bak.9/Database/Migrations/ |
Upload File : |
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class PsStoreAccount extends Migration
{
public function up()
{
$this->db->disableForeignKeyChecks();
$this->forge->addField([
'ps_sa_id' => [
'type' => 'INT',
'constraint' => 5,
'unsigned' => true,
'auto_increment' => true,
],
'sa_name' => [
'type' => 'VARCHAR',
'constraint' => 255,
],
'sa_email' => [
'type' => 'VARCHAR',
'constraint' => 255,
],
'sa_phone' => [
'type' => 'VARCHAR',
'constraint' => 20,
],
'sa_business_address' => [
'type' => 'TEXT',
],
'sa_province' => [
'type' => 'VARCHAR',
'constraint' => 30,
],
'sa_city' => [
'type' => 'VARCHAR',
'constraint' => 20,
],
'sa_district' => [
'type' => 'VARCHAR',
'constraint' => 20,
],
'sa_postal_code' => [
'type' => 'VARCHAR',
'constraint' => 6,
],
'sa_max_store' => [
'type' => 'INT',
'constraint' => 2,
'unsigned' => true,
],
'sa_max_staff' => [
'type' => 'INT',
'constraint' => 2,
'unsigned' => true,
],
'is_using_pos' => [
'type' => 'TINYINT',
'constraint' => 1,
'comment' => '1 = yes, 2 = no'
],
'sa_start_date_agreement' => [
'type' => 'TIMESTAMP',
'null' => true
],
'sa_end_date_agreement' => [
'type' => 'TIMESTAMP',
'null' => true
],
'created_at' => [
'type' => 'TIMESTAMP', 'null' => true
],
'updated_at' => [
'type' => 'TIMESTAMP',
'null' => true
],
'deleted_at' => [
'type' => 'TIMESTAMP',
'null' => true
],
'suspended_at' => [
'type' => 'TIMESTAMP',
'null' => true
],
]);
$this->forge->addKey('ps_sa_id', true);
$this->forge->createTable('ps_store_account');
$this->db->enableForeignKeyChecks();
}
public function down()
{
$this->forge->dropTable('ps_store_account');
}
}