|
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/Database/Migrations/ |
Upload File : |
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class PsStoreConfig extends Migration
{
public function up()
{
$this->db->disableForeignKeyChecks();
$this->forge->addField([
'ps_sc_id' => [
'type' => 'INT',
'constraint' => 5,
'unsigned' => true,
'auto_increment' => true,
],
'ps_store_id' => [
'type' => 'INT',
'constraint' => 5,
'unsigned' => true,
],
'sc_base_color' => [
'type' => 'VARCHAR',
'constraint' => 10,
],
'sc_banner' => [
'type' => 'TEXT',
],
'sc_token' => [
'type' => 'TEXT',
],
'is_tax_enabled' => [
'type' => 'INT',
'constraint' => 2,
'comment' => '1 = enabled, 2 = disabled'
],
'sc_tax_amount' => [
'type' => 'DECIMAL',
'constraint' => '10,2',
],
'xendit_enabled' => [
'type' => 'INT',
'constraint' => 2,
'comment' => '1 = enabled, 2 = disabled'
],
'xendit_public_key' => [
'type' => 'TEXT',
],
'xendit_private_key' => [
'type' => 'TEXT',
],
'xendit_id_prefix' => [
'type' => 'VARCHAR',
'constraint' => 100,
],
'xendit_success_url' => [
'type' => 'VARCHAR',
'constraint' => 255,
],
'xendit_failed_url' => [
'type' => 'VARCHAR',
'constraint' => 255,
],
'mokapos_client_id' => [
'type' => 'TEXT',
],
'mokapos_client_secret' => [
'type' => 'TEXT',
],
'mokapos_token' => [
'type' => 'TEXT',
],
'payment_grouping' => [
'type' => 'TEXT',
],
'created_at' => [
'type' => 'TIMESTAMP', 'null' => true
],
'updated_at' => [
'type' => 'TIMESTAMP',
'null' => true
],
'deleted_at' => [
'type' => 'TIMESTAMP',
'null' => true
],
]);
$this->forge->addKey('ps_sc_id', true);
$this->forge->addForeignKey('ps_store_id', 'ps_store_main', 'ps_store_id');
$this->forge->createTable('ps_store_config');
$this->db->enableForeignKeyChecks();
}
public function down()
{
$this->forge->dropTable('ps_store_config');
}
}