mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-29 10:47:53 -04:00
- Add column to indicate control setting (installed, enabled). - Add column to indicate plugin. - Rework business logic to read the status properly. - Renamed the migration to properly reflect which version it's released in. Signed-off-by: objec <objecttothis@gmail.com>
22 lines
997 B
SQL
22 lines
997 B
SQL
CREATE TABLE IF NOT EXISTS `ospos_plugin_config` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`plugin_id` varchar(100) NOT NULL,
|
|
`key` varchar(100) NOT NULL,
|
|
`value` text NOT NULL,
|
|
`is_control` tinyint(1) NOT NULL DEFAULT 0,
|
|
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
|
|
`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `uq_plugin_key` (`plugin_id`, `key`),
|
|
KEY `idx_plugin_id` (`plugin_id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
|
|
INSERT IGNORE INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES
|
|
('module_plugins', 'module_plugins_desc', 111, 'plugins');
|
|
|
|
INSERT IGNORE INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES
|
|
('plugins', 'plugins');
|
|
|
|
INSERT IGNORE INTO `ospos_grants` (`permission_id`, `person_id`, `menu_group`)
|
|
SELECT 'plugins', `person_id`, 'office' FROM `ospos_grants` WHERE `permission_id` = 'config';
|