HEX
Server: Apache/2.4.37 (CentOS Stream) OpenSSL/1.1.1k
System: Linux ysnet.com.tw 4.18.0-553.5.1.el8.x86_64 #1 SMP Tue May 21 05:46:01 UTC 2024 x86_64
User: test (521)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /var/www/test/wp-content/plugins/bit-assist/backend/db/Migrations/BASTWidgetsTableMigration.php
<?php

if (!defined('ABSPATH')) {
    exit;
}

use BitApps\Assist\Config;
use BitApps\Assist\Deps\BitApps\WPDatabase\Blueprint;
use BitApps\Assist\Deps\BitApps\WPDatabase\Schema;
use BitApps\Assist\Deps\BitApps\WPKit\Migration\Migration;

// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Migration class follows framework naming convention
final class BASTWidgetsTableMigration extends Migration
{
    public function up()
    {
        Schema::withPrefix(Config::get('DB_PREFIX'))->create('widgets', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->longtext('styles')->nullable();
            $table->longtext('domains')->nullable();
            $table->longtext('business_hours')->nullable();
            $table->longtext('exclude_pages')->nullable();
            $table->integer('initial_delay')->defaultValue(0);
            $table->integer('page_scroll')->defaultValue(0);
            $table->tinyint('widget_behavior')->defaultValue(1);
            $table->string('custom_css')->nullable();
            $table->longtext('call_to_action')->nullable();
            $table->boolean('store_responses')->defaultValue(1);
            $table->longtext('delete_responses')->nullable();
            $table->longtext('integrations')->nullable();
            $table->boolean('status')->defaultValue(1);
            $table->boolean('active')->defaultValue(0);
            $table->boolean('hide_credit')->defaultValue(0);
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::withPrefix(Config::get('DB_PREFIX'))->drop('widgets');
    }
}