Commit ead6c69
authored
fix(seed): preserve admin-selected defaults across re-seeds (#468)
The Prisma seed runs on every app boot/upgrade and was force-resetting
default flags, silently reverting an admin's choices with no audit trail
(seed uses the raw Prisma client and bypasses the audit hooks).
Apply the seedDefaultTemplate pattern to every affected seeder: only set a
default on fresh install (no active default exists) and never overwrite the
flag on update.
- PromptConfig: drop the blanket updateMany demotion; set default only on
fresh install; do not touch isDefault on update.
- Roles: stop forcing user->default / admin->non-default on update.
- Workflows: track existing defaults per scope; only seed a default for a
scope that has none yet; do not touch isDefault on update.
- MilestoneTypes: do not touch isDefault on update; seed default only on
fresh install.
Each seeder logs when it preserves an admin's existing choice.1 parent a492403 commit ead6c69
2 files changed
Lines changed: 72 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
63 | 72 | | |
64 | 73 | | |
65 | | - | |
| 74 | + | |
66 | 75 | | |
67 | 76 | | |
68 | | - | |
| 77 | + | |
69 | 78 | | |
70 | 79 | | |
71 | 80 | | |
72 | 81 | | |
73 | | - | |
| 82 | + | |
74 | 83 | | |
75 | 84 | | |
76 | 85 | | |
77 | 86 | | |
78 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
79 | 93 | | |
80 | 94 | | |
81 | 95 | | |
| |||
1422 | 1436 | | |
1423 | 1437 | | |
1424 | 1438 | | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
1425 | 1454 | | |
1426 | 1455 | | |
1427 | 1456 | | |
| |||
1452 | 1481 | | |
1453 | 1482 | | |
1454 | 1483 | | |
1455 | | - | |
| 1484 | + | |
1456 | 1485 | | |
1457 | 1486 | | |
1458 | 1487 | | |
| |||
1463 | 1492 | | |
1464 | 1493 | | |
1465 | 1494 | | |
1466 | | - | |
| 1495 | + | |
| 1496 | + | |
1467 | 1497 | | |
1468 | 1498 | | |
1469 | 1499 | | |
| |||
1542 | 1572 | | |
1543 | 1573 | | |
1544 | 1574 | | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
1545 | 1585 | | |
1546 | 1586 | | |
1547 | 1587 | | |
1548 | 1588 | | |
1549 | 1589 | | |
1550 | 1590 | | |
1551 | | - | |
| 1591 | + | |
1552 | 1592 | | |
1553 | 1593 | | |
1554 | 1594 | | |
1555 | 1595 | | |
1556 | 1596 | | |
1557 | | - | |
| 1597 | + | |
| 1598 | + | |
1558 | 1599 | | |
1559 | 1600 | | |
1560 | 1601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
15 | 24 | | |
16 | 25 | | |
17 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
18 | 29 | | |
19 | 30 | | |
20 | | - | |
| 31 | + | |
21 | 32 | | |
22 | 33 | | |
23 | 34 | | |
24 | 35 | | |
25 | | - | |
| 36 | + | |
26 | 37 | | |
27 | 38 | | |
28 | 39 | | |
29 | 40 | | |
30 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
31 | 48 | | |
32 | 49 | | |
33 | 50 | | |
| |||
0 commit comments