<?php

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

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

        DB::statement("DROP TABLE IF EXISTS `payment_transaction_status`;");
        DB::statement("

CREATE TABLE `payment_transaction_status`  (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` varchar(200)  NOT NULL,
  `language_key` varchar(255)  NULL DEFAULT NULL,
  `status` tinyint(4) NOT NULL DEFAULT 1,
  `created_by` int(10) UNSIGNED NOT NULL,
  `updated_by` int(10) UNSIGNED NOT NULL,
  `created_at` int(11) NOT NULL,
  `updated_at` int(11) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  INDEX `property_type_created_by_foreign`(`created_by`) USING BTREE,
  INDEX `property_type_updated_by_foreign`(`updated_by`) USING BTREE
)


        ");


        DB::statement("INSERT INTO `payment_transaction_status` VALUES (1, 'Success', 'enw-payment_transaction-status-success', 1, 1, 1, 1, 1),(2, 'Start', 'enw-payment_transaction-status-start', 1, 1, 1, 1, 1), (3, 'Pending', 'enw-payment_transaction-status-pending', 1, 1, 1, 1, 1), (4, 'Cancel/Refund', 'enw-payment_transaction-status-cancel_refund', 1, 1, 1, 1, 1), (5, 'Manual Payment', 'enw-payment_transaction-status-manual_payment ', 1, 1, 1, 1, 1);") ;

        DB::statement("INSERT INTO `payment_transaction_status` VALUES (0, 'Error', 'enw-payment_transaction-status-error', 1, 1, 1, 1, 1);");

        DB::statement("UPDATE`payment_transaction_status` SET id = 0 WHERE id = 6 ;");


    }

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