Files
XC_VM/src/Modules/watch/migrations/1.0.1.sql
T
Divarion-D 58656fa396 refactor(modules): master/drop/migrations schema layout + harden install
Mirror core's DB layout at the module level: one master database.sql (full
current schema), one database_drop.sql (teardown), and forward-only
migrations/<semver>.sql deltas. ModuleMigrator gains install()/uninstall();
up() reads migrations/*.sql; down() removed.

- watch: database.sql (delete_missing folded into watch_folders),
  database_drop.sql, migrations/1.0.1.sql; drop 1.0.0.up/down.sql;
  getVersion() -> 1.0.1 (matches module.json).
- Move core migration 004_add_watch_delete_missing.sql into the watch module.
- installModule no longer wraps the DDL migration in a transaction: MySQL/MariaDB
  implicitly commit DDL, so the wrapping rollback() only masked the real SQL error.
- syncBundledModules retries a previously-failed install (skips only admin-disabled)
  so `console.php status` self-heals.
2026-07-02 21:28:33 +03:00

8 lines
484 B
SQL

-- watch module — version delta 1.0.1 (forward-only)
-- Upgrades panels installed on an older schema: adds the delete_missing flag to
-- watch_folders. Fresh installs get this column from database.sql (master) and
-- never run this file. Idempotent, so it is a no-op where the column already
-- exists (e.g. from the former core migration 004_add_watch_delete_missing.sql).
ALTER TABLE `watch_folders`
ADD COLUMN IF NOT EXISTS `delete_missing` tinyint(1) DEFAULT 0 AFTER `active`;