Add plugin migration system

- Add `runPendingMigrations()` to `PluginManager` for executing plugin-specific migrations.
- Create `PluginMigrationModel` for managing plugin migration versions.
- Add migration for creating the `plugin_migrations` table to track migration states.

Signed-off-by: objec <objecttothis@gmail.com>
This commit is contained in:
objec
2026-06-26 16:19:04 +04:00
parent 11ece3f1a3
commit 150cdfb2b8
4 changed files with 136 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
CREATE TABLE IF NOT EXISTS `ospos_plugin_migrations` (
`plugin_id` varchar(100) NOT NULL,
`version` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`ran_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`plugin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;