mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 22:25:24 +00:00
fix: maintenance index name, shared host read only view and badge polling
This commit is contained in:
1 parent
5ff5ae19d9
commit
3b58415f8f
16 files changed
+166
-37
No files matched your search
@@ -800,6 +800,13 @@ CREATE TABLE IF NOT EXISTS `p_automations_host_maintenance` (
|
||||
);
|
||||
CREATE UNIQUE INDEX `maintenance_host_owner` ON `p_automations_host_maintenance` (`user_id`, `host_id`);
|
||||
|
||||
-- ==== plugin automations 0004_rename_maintenance_index.sql ====
|
||||
-- automations 0004: rename_maintenance_index
|
||||
-- Renames the maintenance index to the idx_ pattern every other index uses.
|
||||
|
||||
CREATE UNIQUE INDEX `idx_automation_maintenance_host_owner` ON `p_automations_host_maintenance` (`user_id`, `host_id`);
|
||||
DROP INDEX `maintenance_host_owner` ON `p_automations_host_maintenance`;
|
||||
|
||||
-- ==== plugin homepage 0001_adopt_homepage_tables.sql ====
|
||||
-- homepage 0001: adopt_homepage_tables
|
||||
-- Generated by termix-plugin migrations. Review before committing.
|
||||
|
||||
@@ -841,6 +841,13 @@ CREATE TABLE IF NOT EXISTS "p_automations_host_maintenance" (
|
||||
);
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS "maintenance_host_owner" ON "p_automations_host_maintenance" ("user_id", "host_id");
|
||||
|
||||
-- ==== plugin automations 0004_rename_maintenance_index.sql ====
|
||||
-- automations 0004: rename_maintenance_index
|
||||
-- Renames the maintenance index to the idx_ pattern every other index uses.
|
||||
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS "idx_automation_maintenance_host_owner" ON "p_automations_host_maintenance" ("user_id", "host_id");
|
||||
DROP INDEX IF EXISTS "maintenance_host_owner";
|
||||
|
||||
-- ==== plugin homepage 0001_adopt_homepage_tables.sql ====
|
||||
-- homepage 0001: adopt_homepage_tables
|
||||
-- Generated by termix-plugin migrations. Review before committing.
|
||||
|
||||
@@ -169,14 +169,21 @@ describe("the migration checker", () => {
|
||||
for (const dialect of ["sqlite", "postgres", "mysql"]) {
|
||||
const dir = path.join(plugins, id, "migrations", dialect);
|
||||
if (!fs.existsSync(dir)) continue;
|
||||
for (const file of fs.readdirSync(dir)) {
|
||||
if (!file.endsWith(".sql")) continue;
|
||||
const sql = fs.readFileSync(path.join(dir, file), "utf8");
|
||||
const files = fs
|
||||
.readdirSync(dir)
|
||||
.filter((file) => file.endsWith(".sql"))
|
||||
.sort();
|
||||
const sqls = files.map((file) =>
|
||||
fs.readFileSync(path.join(dir, file), "utf8"),
|
||||
);
|
||||
// The runner lets a later migration drop an index an earlier one made.
|
||||
const ownedIndexes = collectOwnedIndexes(id, sqls, legacy);
|
||||
files.forEach((file, index) => {
|
||||
expect(
|
||||
findUnownedTableWrites(id, sql, legacy),
|
||||
findUnownedTableWrites(id, sqls[index], legacy, ownedIndexes),
|
||||
`${id}/${dialect}/${file}`,
|
||||
).toEqual([]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user