<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class PaymentTypeChangeNameData extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {

        DB::statement("SET FOREIGN_KEY_CHECKS = 0");
        DB::statement("DROP TABLE IF EXISTS `payment_type`;");
        DB::statement("
            CREATE TABLE `payment_type`  (
              `id` int(11) NOT NULL AUTO_INCREMENT,
              `pos_code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
              `bank_code` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
              `threed_model` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
              `name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
              `params` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL,
              `installment` tinyint(1) NULL DEFAULT NULL COMMENT '0:Active, 1:Passive',
              `icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
              `status` tinyint(1) NULL DEFAULT NULL COMMENT '0: Passive, 1: ActiveProd, 2: Test',
              `created_by` int(11) NULL DEFAULT NULL,
              `updated_by` int(11) NULL DEFAULT NULL,
              `created_at` int(11) NULL DEFAULT NULL,
              `updated_at` int(11) NULL DEFAULT NULL,
              PRIMARY KEY (`id`) USING BTREE
            );
        ");
        DB::statement("INSERT INTO `payment_type` VALUES (1, 'POS', 'akbank', '3d_pay', 'Akbank', '{\"clientId\":{\"key\":\"client_id\",\"name\":\"payment_type-akbank-client_id\"},\"storeKey\":{\"key\":\"store_key\",\"name\":\"payment_type-akbank-store_key\"}}', 1, NULL, 1, 1, 1, 1, 1);");
        DB::statement("INSERT INTO `payment_type` VALUES (2, 'POS', 'garanti', '3d_pay', 'Garanti Bankası', '{\"clientId\":{\"key\":\"client_id\",\"name\":\"payment_type-garanti-client_id\"},\"terminalId\":{\"key\":\"client_id\",\"name\":\"payment_type-garanti-terminal_id\"},\"userName\":{\"key\":\"username\",\"name\":\"payment_type-garanti-username\"},\"password\":{\"key\":\"password\",\"name\":\"payment_type-garanti-password\"},\"storeKey\":{\"key\":\"store_key\",\"name\":\"payment_type-garanti-store_key\"}}', 1, NULL, 1, 1, 1, 1, 1);");
        DB::statement("INSERT INTO `payment_type` VALUES (3, 'POS', 'yapikredi', '3d', 'Yapı Kredi Bankası', '{\"clientId\":{\"key\":\"client_id\",\"name\":\"payment_type-yapikredi-client_id\"},\"terminalId\":{\"key\":\"client_id\",\"name\":\"payment_type-yapikredi-terminal_id\"},\"posnetId\":{\"key\":\"posnet_id\",\"name\":\"payment_type-yapikredi-posnet_id\"},\"userName\":{\"key\":\"username\",\"name\":\"payment_type-yapikredi-username\"},\"password\":{\"key\":\"password\",\"name\":\"payment_type-yapikredi-password\"},\"storeKey\":{\"key\":\"store_key\",\"name\":\"payment_type-yapikredi-store_key\"}}', 1, NULL, 1, 1, 1, 1, 1);");
        DB::statement("INSERT INTO `payment_type` VALUES (4, 'POS', 'halkbank', '3d_pay', 'Halkbank', '{\"clientId\":{\"key\":\"client_id\",\"name\":\"payment_type-halkbank-client_id\"},\"storeKey\":{\"key\":\"store_key\",\"name\":\"payment_type-halkbank-store_key\"}}', 1, NULL, 1, 1, 1, 1, 1);");
        DB::statement("INSERT INTO `payment_type` VALUES (5, 'POS', 'denizbank', '3d_pay', 'DenizBank', '{\"clientId\":{\"key\":\"client_id\",\"name\":\"payment_type-denizbank-client_id\"},\"storeKey\":{\"key\":\"store_key\",\"name\":\"payment_type-denizbank-store_key\"}}', 1, NULL, 1, 1, 1, 1, 1);");
        DB::statement("INSERT INTO `payment_type` VALUES (20, 'STR', 'stripe', NULL, 'Stripe', '{\"secretKey\":{\"key\":\"secret_key\",\"name\":\"payment_type-stripe-secret_key\"}}', 1, NULL, 1, 1, 1, 1, 1);");

        DB::statement("SET FOREIGN_KEY_CHECKS = 1");
    }



    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
