|
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.3/Database/Migrations/ |
Upload File : |
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class PsStoreSalesOrder extends Migration
{
public function up()
{
$this->db->disableForeignKeyChecks();
$this->forge->addField([
'ps_sso_id' => [
'type' => 'INT',
'constraint' => 5,
'unsigned' => true,
'auto_increment' => true,
],
'ps_store_id' => [
'type' => 'INT',
'constraint' => 5,
'unsigned' => true,
],
'ps_table_id' => [
'type' => 'INT',
'constraint' => 5,
'unsigned' => true,
],
'ps_scc_id' => [
'type' => 'INT',
'constraint' => 5,
'unsigned' => true,
'null' => true,
],
'sso_order_number' => [
'type' => 'VARCHAR',
'constraint' => 50,
],
'sso_customer_name' => [
'type' => 'VARCHAR',
'constraint' => 50,
],
'sso_customer_phone' => [
'type' => 'VARCHAR',
'constraint' => 20,
],
'sso_customer_email' => [
'type' => 'VARCHAR',
'constraint' => 100,
],
'sso_subtotal' => [
'type' => 'DECIMAL',
'constraint' => '10,2',
],
'sso_discount_amount' => [
'type' => 'DECIMAL',
'constraint' => '10,2',
],
'sso_tax_amount' => [
'type' => 'DECIMAL',
'constraint' => '10,2',
],
'sso_tax_percent' => [
'type' => 'DECIMAL',
'constraint' => '3,2',
'unsigned' => true,
],
'sso_grand_total' => [
'type' => 'DECIMAL',
'constraint' => '10,2',
],
'sso_status' => [
'type' => 'INT',
'constraint' => 1,
],
'sso_payment_method' => [
'type' => 'VARCHAR',
'constraint' => 20,
],
'created_at' => [
'type' => 'TIMESTAMP', 'null' => true
],
'updated_at' => [
'type' => 'TIMESTAMP',
'null' => true
],
'deleted_at' => [
'type' => 'TIMESTAMP',
'null' => true
],
]);
$this->forge->addKey('ps_sso_id', true);
$this->forge->addForeignKey('ps_store_id', 'ps_store_main', 'ps_store_id');
$this->forge->addForeignKey('ps_table_id', 'ps_store_table', 'ps_table_id');
$this->forge->addForeignKey('ps_scc_id', 'ps_store_coupon_code', 'ps_scc_id');
$this->forge->createTable('ps_store_sales_order');
$this->db->enableForeignKeyChecks();
}
public function down()
{
$this->forge->dropTable('ps_store_sales_order');
}
}