Files
opensourcepos/app/Database/Migrations/20261026000000_PluginConfigTableCreate.php
objecttothis 7f354a66ee refactor(plugins): rename plugin migrations table migration to config table
- Rename core migration 20260627000000_PluginMigrationsTableCreate to
  20261026000000_PluginConfigTableCreate, merging plugin_migrations
  table creation into the same SQL script as plugin_config and adding
  a startup log message; down() now drops both tables.
- Consolidate the plugin_migrations CREATE TABLE statement into
  3.5.0_PluginConfigTableCreate.sql and remove the now-redundant
  3.5.1_PluginMigrationsTableCreate.sql script.
- Update app/Plugins/README.md reference to the renamed migration
  class.
- Add WhatsAppPlugin migration CreateWhatsAppMessagesTable to create
  the whatsapp_messages conversation log table (utf8mb4, unique
  wa_message_id to dedupe webhook redelivery); dropped explicitly by
  WhatsAppPlugin::uninstall() instead of a down() method.

Signed-off-by: objecttothis <17935339+objecttothis@users.noreply.github.com>
2026-10-27 17:28:12 +04:00

23 lines
538 B
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class PluginConfigTableCreate extends Migration
{
public function up(): void
{
log_message('info', 'Migrating plugin_config table started');
helper('migration');
executeScript(APPPATH . 'Database/Migrations/sqlscripts/3.5.0_PluginConfigTableCreate.sql');
}
public function down(): void
{
$this->forge->dropTable('plugin_migrations', true);
$this->forge->dropTable('plugin_config', true);
}
}