Skip to content

Commit b1c2a33

Browse files
committed
chore(folders): drop production figures from migration and code comments
This repository is public. The 0274 header and the Recently Deleted policy comment carried concrete counts and ratios taken from the production database, which is operational detail that does not belong in open source. Both now state the property that matters — what was asserted, and why disabled-on-restore is the safe default — without the underlying numbers.
1 parent 87ffb4a commit b1c2a33

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

apps/sim/app/workspace/[workspaceId]/settings/components/recently-deleted/recently-deleted.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ const FOLDER_TREE_TAB_BY_TYPE = new Map<ResourceType, ResourceType>(
165165
/**
166166
* Restore brings a workflow back but deliberately does NOT re-enable its schedules, webhooks,
167167
* or chats. Archive overwrites their enabled state without recording what it was, so restoring
168-
* to a constant would re-enable something the user had switched off — on production roughly
169-
* half of live schedules sit at `disabled` and ~12% of live webhooks at `isActive: false`, so
170-
* that is the common case, not the edge case.
168+
* to a constant would re-enable something the user had deliberately switched off — and a
169+
* deliberately-disabled schedule or webhook is a common state, not an edge case, so that would
170+
* be wrong more often than right.
171171
*
172172
* Leaving it off is the safe choice; leaving it UNSAID is not. Restoring anything that carries
173173
* automations says so at the moment of restore, so re-enabling is a known step rather than a

packages/db/migrations/0274_file_folder_cutover_reconcile.sql

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,19 @@
2323
-- after this runs. The block is idempotent and safe to repeat; a journaled migration does not
2424
-- replay, so the post-drain pass is an operational step, not an automatic one.
2525
--
26-
-- On an environment where 0272 has not yet run — production at time of writing — 0272 and this
27-
-- file apply back to back and this is a no-op reconcile over the rows 0272 just wrote.
26+
-- Where 0272 has not yet run, it and this file apply back to back and this becomes a no-op
27+
-- reconcile over the rows 0272 just wrote.
2828
--
29-
-- Dry-run against production (read-only), materialising the full post-0272 `folder` table from
30-
-- both source tables and checking every constraint the table declares: 34,991 rows, and 0 of
31-
-- each of — NULL names, NULL required columns, primary-key collisions between the two source
32-
-- tables, `folder_workspace_resource_parent_name_active_unique` violations, resource-type or
33-
-- workspace violations of `folder_parent_resource_type_match`, and parent/user/workspace FK
34-
-- violations. Longest generated name 55 chars. 0272's dedup renames 47 workflow folders and 0
35-
-- file folders (the legacy table's own active-unique index guarantees the latter, which is why
36-
-- pass 2 below can write raw names). All 5,475 foldered files and 4,593 foldered workflows keep
37-
-- a resolvable folder id.
29+
-- Validated with a read-only dry run that materialises the full post-0272 `folder` table from
30+
-- both source tables and asserts every constraint the table declares: no NULL names or NULL
31+
-- required columns, no primary-key collisions between the two source tables, no
32+
-- `folder_workspace_resource_parent_name_active_unique` violations, no resource-type or
33+
-- workspace violations of `folder_parent_resource_type_match`, and no parent/user/workspace FK
34+
-- violations, with every foldered file and workflow keeping a resolvable folder id.
35+
--
36+
-- 0272's dedup renames only workflow folders, never file folders: `workspace_file_folders`
37+
-- enforces the same active-unique key this table does, so no file folder can arrive duplicated.
38+
-- That is what lets pass 2 below write raw names.
3839

3940
-- Wrapped in a DO block so the two passes are ONE statement and therefore atomic on their own.
4041
-- 0272 ends with an embedded COMMIT (its trailing CONCURRENTLY index builds cannot run inside a

0 commit comments

Comments
 (0)