@warlock.js/cascade 4.1.15 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSE +21 -0
  3. package/cjs/index.cjs +21388 -0
  4. package/cjs/index.cjs.map +1 -0
  5. package/esm/context/database-data-source-context.d.mts +1 -1
  6. package/esm/context/database-data-source-context.d.mts.map +1 -1
  7. package/esm/context/database-data-source-context.mjs +1 -1
  8. package/esm/context/database-data-source-context.mjs.map +1 -1
  9. package/esm/context/database-transaction-context.d.mts +1 -1
  10. package/esm/context/database-transaction-context.d.mts.map +1 -1
  11. package/esm/context/database-transaction-context.mjs +1 -1
  12. package/esm/context/database-transaction-context.mjs.map +1 -1
  13. package/esm/contracts/database-driver.contract.d.mts +1 -1
  14. package/esm/contracts/database-driver.contract.d.mts.map +1 -1
  15. package/esm/contracts/database-id-generator.contract.d.mts +1 -1
  16. package/esm/contracts/database-id-generator.contract.d.mts.map +1 -1
  17. package/esm/contracts/database-remover.contract.d.mts +1 -1
  18. package/esm/contracts/database-remover.contract.d.mts.map +1 -1
  19. package/esm/contracts/database-restorer.contract.d.mts +1 -1
  20. package/esm/contracts/database-restorer.contract.d.mts.map +1 -1
  21. package/esm/contracts/database-writer.contract.d.mts +1 -1
  22. package/esm/contracts/database-writer.contract.d.mts.map +1 -1
  23. package/esm/contracts/driver-blueprint.contract.d.mts +1 -1
  24. package/esm/contracts/driver-blueprint.contract.d.mts.map +1 -1
  25. package/esm/contracts/migration-driver.contract.d.mts +1 -1
  26. package/esm/contracts/migration-driver.contract.d.mts.map +1 -1
  27. package/esm/contracts/query-builder.contract.d.mts +1 -1
  28. package/esm/contracts/query-builder.contract.d.mts.map +1 -1
  29. package/esm/contracts/sync-adapter.contract.d.mts +1 -1
  30. package/esm/contracts/sync-adapter.contract.d.mts.map +1 -1
  31. package/esm/data-source/data-source-registry.d.mts +1 -1
  32. package/esm/data-source/data-source-registry.d.mts.map +1 -1
  33. package/esm/data-source/data-source-registry.mjs +1 -1
  34. package/esm/data-source/data-source-registry.mjs.map +1 -1
  35. package/esm/data-source/data-source.d.mts +1 -1
  36. package/esm/data-source/data-source.d.mts.map +1 -1
  37. package/esm/data-source/data-source.mjs +1 -1
  38. package/esm/data-source/data-source.mjs.map +1 -1
  39. package/esm/database-dirty-tracker.d.mts +1 -1
  40. package/esm/database-dirty-tracker.d.mts.map +1 -1
  41. package/esm/database-dirty-tracker.mjs +1 -1
  42. package/esm/database-dirty-tracker.mjs.map +1 -1
  43. package/esm/drivers/mongodb/mongodb-blueprint.mjs +1 -1
  44. package/esm/drivers/mongodb/mongodb-blueprint.mjs.map +1 -1
  45. package/esm/drivers/mongodb/mongodb-driver.d.mts +1 -1
  46. package/esm/drivers/mongodb/mongodb-driver.d.mts.map +1 -1
  47. package/esm/drivers/mongodb/mongodb-driver.mjs +2 -2
  48. package/esm/drivers/mongodb/mongodb-driver.mjs.map +1 -1
  49. package/esm/drivers/mongodb/mongodb-id-generator.d.mts +1 -1
  50. package/esm/drivers/mongodb/mongodb-id-generator.d.mts.map +1 -1
  51. package/esm/drivers/mongodb/mongodb-id-generator.mjs +1 -1
  52. package/esm/drivers/mongodb/mongodb-id-generator.mjs.map +1 -1
  53. package/esm/drivers/mongodb/mongodb-migration-driver.d.mts +1 -1
  54. package/esm/drivers/mongodb/mongodb-migration-driver.d.mts.map +1 -1
  55. package/esm/drivers/mongodb/mongodb-migration-driver.mjs +1 -1
  56. package/esm/drivers/mongodb/mongodb-migration-driver.mjs.map +1 -1
  57. package/esm/drivers/mongodb/mongodb-query-builder.d.mts +1 -1
  58. package/esm/drivers/mongodb/mongodb-query-builder.d.mts.map +1 -1
  59. package/esm/drivers/mongodb/mongodb-query-builder.mjs +1 -1
  60. package/esm/drivers/mongodb/mongodb-query-builder.mjs.map +1 -1
  61. package/esm/drivers/mongodb/mongodb-query-operations.d.mts +1 -1
  62. package/esm/drivers/mongodb/mongodb-query-operations.d.mts.map +1 -1
  63. package/esm/drivers/mongodb/mongodb-query-operations.mjs +1 -1
  64. package/esm/drivers/mongodb/mongodb-query-operations.mjs.map +1 -1
  65. package/esm/drivers/mongodb/mongodb-query-parser.d.mts +1 -1
  66. package/esm/drivers/mongodb/mongodb-query-parser.d.mts.map +1 -1
  67. package/esm/drivers/mongodb/mongodb-query-parser.mjs +1 -1
  68. package/esm/drivers/mongodb/mongodb-query-parser.mjs.map +1 -1
  69. package/esm/drivers/mongodb/mongodb-sync-adapter.d.mts +1 -1
  70. package/esm/drivers/mongodb/mongodb-sync-adapter.d.mts.map +1 -1
  71. package/esm/drivers/mongodb/mongodb-sync-adapter.mjs +1 -1
  72. package/esm/drivers/mongodb/mongodb-sync-adapter.mjs.map +1 -1
  73. package/esm/drivers/mongodb/types.d.mts +1 -1
  74. package/esm/drivers/mongodb/types.d.mts.map +1 -1
  75. package/esm/drivers/postgres/postgres-blueprint.d.mts +1 -1
  76. package/esm/drivers/postgres/postgres-blueprint.d.mts.map +1 -1
  77. package/esm/drivers/postgres/postgres-blueprint.mjs +1 -1
  78. package/esm/drivers/postgres/postgres-blueprint.mjs.map +1 -1
  79. package/esm/drivers/postgres/postgres-dialect.d.mts +1 -1
  80. package/esm/drivers/postgres/postgres-dialect.d.mts.map +1 -1
  81. package/esm/drivers/postgres/postgres-dialect.mjs +1 -1
  82. package/esm/drivers/postgres/postgres-dialect.mjs.map +1 -1
  83. package/esm/drivers/postgres/postgres-driver.d.mts +1 -1
  84. package/esm/drivers/postgres/postgres-driver.d.mts.map +1 -1
  85. package/esm/drivers/postgres/postgres-driver.mjs +2 -2
  86. package/esm/drivers/postgres/postgres-driver.mjs.map +1 -1
  87. package/esm/drivers/postgres/postgres-migration-driver.d.mts +1 -1
  88. package/esm/drivers/postgres/postgres-migration-driver.d.mts.map +1 -1
  89. package/esm/drivers/postgres/postgres-migration-driver.mjs +1 -1
  90. package/esm/drivers/postgres/postgres-migration-driver.mjs.map +1 -1
  91. package/esm/drivers/postgres/postgres-query-builder.d.mts +1 -1
  92. package/esm/drivers/postgres/postgres-query-builder.d.mts.map +1 -1
  93. package/esm/drivers/postgres/postgres-query-builder.mjs +7 -5
  94. package/esm/drivers/postgres/postgres-query-builder.mjs.map +1 -1
  95. package/esm/drivers/postgres/postgres-query-parser.d.mts +1 -1
  96. package/esm/drivers/postgres/postgres-query-parser.d.mts.map +1 -1
  97. package/esm/drivers/postgres/postgres-query-parser.mjs +1 -1
  98. package/esm/drivers/postgres/postgres-query-parser.mjs.map +1 -1
  99. package/esm/drivers/postgres/postgres-sql-serializer.mjs +1 -1
  100. package/esm/drivers/postgres/postgres-sql-serializer.mjs.map +1 -1
  101. package/esm/drivers/postgres/postgres-sync-adapter.d.mts +1 -1
  102. package/esm/drivers/postgres/postgres-sync-adapter.d.mts.map +1 -1
  103. package/esm/drivers/postgres/postgres-sync-adapter.mjs +1 -1
  104. package/esm/drivers/postgres/postgres-sync-adapter.mjs.map +1 -1
  105. package/esm/drivers/postgres/types.d.mts +1 -1
  106. package/esm/drivers/postgres/types.d.mts.map +1 -1
  107. package/esm/drivers/sql/sql-dialect.contract.d.mts +1 -1
  108. package/esm/drivers/sql/sql-dialect.contract.d.mts.map +1 -1
  109. package/esm/drivers/sql/sql-types.d.mts +1 -1
  110. package/esm/drivers/sql/sql-types.d.mts.map +1 -1
  111. package/esm/errors/missing-data-source.error.d.mts +1 -1
  112. package/esm/errors/missing-data-source.error.d.mts.map +1 -1
  113. package/esm/errors/missing-data-source.error.mjs +1 -1
  114. package/esm/errors/missing-data-source.error.mjs.map +1 -1
  115. package/esm/errors/transaction-rollback.error.d.mts +1 -1
  116. package/esm/errors/transaction-rollback.error.d.mts.map +1 -1
  117. package/esm/errors/transaction-rollback.error.mjs +1 -1
  118. package/esm/errors/transaction-rollback.error.mjs.map +1 -1
  119. package/esm/events/model-events.d.mts +1 -1
  120. package/esm/events/model-events.d.mts.map +1 -1
  121. package/esm/events/model-events.mjs +1 -1
  122. package/esm/events/model-events.mjs.map +1 -1
  123. package/esm/expressions/aggregate-expressions.d.mts +1 -1
  124. package/esm/expressions/aggregate-expressions.d.mts.map +1 -1
  125. package/esm/expressions/aggregate-expressions.mjs +1 -1
  126. package/esm/expressions/aggregate-expressions.mjs.map +1 -1
  127. package/esm/migration/column-builder.d.mts +1 -1
  128. package/esm/migration/column-builder.d.mts.map +1 -1
  129. package/esm/migration/column-builder.mjs +1 -1
  130. package/esm/migration/column-builder.mjs.map +1 -1
  131. package/esm/migration/column-helpers.d.mts +1 -1
  132. package/esm/migration/column-helpers.d.mts.map +1 -1
  133. package/esm/migration/column-helpers.mjs +1 -1
  134. package/esm/migration/column-helpers.mjs.map +1 -1
  135. package/esm/migration/foreign-key-builder.d.mts +1 -1
  136. package/esm/migration/foreign-key-builder.d.mts.map +1 -1
  137. package/esm/migration/foreign-key-builder.mjs +1 -1
  138. package/esm/migration/foreign-key-builder.mjs.map +1 -1
  139. package/esm/migration/migration-runner.d.mts +1 -1
  140. package/esm/migration/migration-runner.d.mts.map +1 -1
  141. package/esm/migration/migration-runner.mjs +1 -1
  142. package/esm/migration/migration-runner.mjs.map +1 -1
  143. package/esm/migration/migration.d.mts +1 -1
  144. package/esm/migration/migration.d.mts.map +1 -1
  145. package/esm/migration/migration.mjs +1 -1
  146. package/esm/migration/migration.mjs.map +1 -1
  147. package/esm/migration/sql-grammar.mjs +1 -1
  148. package/esm/migration/sql-grammar.mjs.map +1 -1
  149. package/esm/migration/sql-serializer.d.mts +1 -1
  150. package/esm/migration/sql-serializer.d.mts.map +1 -1
  151. package/esm/migration/sql-serializer.mjs +1 -1
  152. package/esm/migration/sql-serializer.mjs.map +1 -1
  153. package/esm/migration/types.d.mts +1 -1
  154. package/esm/migration/types.d.mts.map +1 -1
  155. package/esm/model/methods/accessor-methods.mjs +1 -1
  156. package/esm/model/methods/accessor-methods.mjs.map +1 -1
  157. package/esm/model/methods/delete-methods.mjs +1 -1
  158. package/esm/model/methods/delete-methods.mjs.map +1 -1
  159. package/esm/model/methods/dirty-methods.mjs +1 -1
  160. package/esm/model/methods/dirty-methods.mjs.map +1 -1
  161. package/esm/model/methods/hydration-methods.mjs +1 -1
  162. package/esm/model/methods/hydration-methods.mjs.map +1 -1
  163. package/esm/model/methods/instance-event-methods.mjs +1 -1
  164. package/esm/model/methods/instance-event-methods.mjs.map +1 -1
  165. package/esm/model/methods/meta-methods.mjs +1 -1
  166. package/esm/model/methods/meta-methods.mjs.map +1 -1
  167. package/esm/model/methods/pivot-methods.mjs +1 -1
  168. package/esm/model/methods/pivot-methods.mjs.map +1 -1
  169. package/esm/model/methods/query-methods.mjs +1 -1
  170. package/esm/model/methods/query-methods.mjs.map +1 -1
  171. package/esm/model/methods/restore-methods.mjs +1 -1
  172. package/esm/model/methods/restore-methods.mjs.map +1 -1
  173. package/esm/model/methods/scope-methods.mjs +1 -1
  174. package/esm/model/methods/scope-methods.mjs.map +1 -1
  175. package/esm/model/methods/serialization-methods.mjs +1 -1
  176. package/esm/model/methods/serialization-methods.mjs.map +1 -1
  177. package/esm/model/methods/static-event-methods.mjs +1 -1
  178. package/esm/model/methods/static-event-methods.mjs.map +1 -1
  179. package/esm/model/methods/write-methods.mjs +1 -1
  180. package/esm/model/methods/write-methods.mjs.map +1 -1
  181. package/esm/model/model.d.mts +1 -1
  182. package/esm/model/model.d.mts.map +1 -1
  183. package/esm/model/model.mjs +1 -1
  184. package/esm/model/model.mjs.map +1 -1
  185. package/esm/model/model.types.d.mts +1 -1
  186. package/esm/model/model.types.d.mts.map +1 -1
  187. package/esm/model/register-model.d.mts +1 -1
  188. package/esm/model/register-model.d.mts.map +1 -1
  189. package/esm/model/register-model.mjs +1 -1
  190. package/esm/model/register-model.mjs.map +1 -1
  191. package/esm/model/relation-decorators.d.mts +1 -1
  192. package/esm/model/relation-decorators.d.mts.map +1 -1
  193. package/esm/model/relation-decorators.mjs +2 -2
  194. package/esm/model/relation-decorators.mjs.map +1 -1
  195. package/esm/operations/database.d.mts +1 -1
  196. package/esm/operations/database.d.mts.map +1 -1
  197. package/esm/operations/database.mjs +1 -1
  198. package/esm/operations/database.mjs.map +1 -1
  199. package/esm/operations/migrations.d.mts +1 -1
  200. package/esm/operations/migrations.d.mts.map +1 -1
  201. package/esm/operations/migrations.mjs +1 -1
  202. package/esm/operations/migrations.mjs.map +1 -1
  203. package/esm/query-builder/query-builder.d.mts +1 -1
  204. package/esm/query-builder/query-builder.d.mts.map +1 -1
  205. package/esm/query-builder/query-builder.mjs +1 -1
  206. package/esm/query-builder/query-builder.mjs.map +1 -1
  207. package/esm/relations/key-conventions.mjs +1 -1
  208. package/esm/relations/key-conventions.mjs.map +1 -1
  209. package/esm/relations/pivot-operations.d.mts +1 -1
  210. package/esm/relations/pivot-operations.d.mts.map +1 -1
  211. package/esm/relations/pivot-operations.mjs +1 -1
  212. package/esm/relations/pivot-operations.mjs.map +1 -1
  213. package/esm/relations/relation-hydrator.d.mts +1 -1
  214. package/esm/relations/relation-hydrator.d.mts.map +1 -1
  215. package/esm/relations/relation-hydrator.mjs +1 -1
  216. package/esm/relations/relation-hydrator.mjs.map +1 -1
  217. package/esm/relations/relation-loader.d.mts +1 -1
  218. package/esm/relations/relation-loader.d.mts.map +1 -1
  219. package/esm/relations/relation-loader.mjs +1 -1
  220. package/esm/relations/relation-loader.mjs.map +1 -1
  221. package/esm/relations/types.d.mts +1 -1
  222. package/esm/relations/types.d.mts.map +1 -1
  223. package/esm/remover/database-remover.d.mts +1 -1
  224. package/esm/remover/database-remover.d.mts.map +1 -1
  225. package/esm/remover/database-remover.mjs +1 -1
  226. package/esm/remover/database-remover.mjs.map +1 -1
  227. package/esm/restorer/database-restorer.d.mts +1 -1
  228. package/esm/restorer/database-restorer.d.mts.map +1 -1
  229. package/esm/restorer/database-restorer.mjs +1 -1
  230. package/esm/restorer/database-restorer.mjs.map +1 -1
  231. package/esm/sql-database-dirty-tracker.d.mts +1 -1
  232. package/esm/sql-database-dirty-tracker.d.mts.map +1 -1
  233. package/esm/sql-database-dirty-tracker.mjs +1 -1
  234. package/esm/sql-database-dirty-tracker.mjs.map +1 -1
  235. package/esm/sync/model-events.mjs +1 -1
  236. package/esm/sync/model-events.mjs.map +1 -1
  237. package/esm/sync/model-sync-operation.d.mts +1 -1
  238. package/esm/sync/model-sync-operation.d.mts.map +1 -1
  239. package/esm/sync/model-sync-operation.mjs +1 -1
  240. package/esm/sync/model-sync-operation.mjs.map +1 -1
  241. package/esm/sync/model-sync.d.mts +1 -1
  242. package/esm/sync/model-sync.d.mts.map +1 -1
  243. package/esm/sync/model-sync.mjs +1 -1
  244. package/esm/sync/model-sync.mjs.map +1 -1
  245. package/esm/sync/sync-context.d.mts +1 -1
  246. package/esm/sync/sync-context.d.mts.map +1 -1
  247. package/esm/sync/sync-context.mjs +1 -1
  248. package/esm/sync/sync-context.mjs.map +1 -1
  249. package/esm/sync/sync-manager.d.mts +1 -1
  250. package/esm/sync/sync-manager.d.mts.map +1 -1
  251. package/esm/sync/sync-manager.mjs +1 -1
  252. package/esm/sync/sync-manager.mjs.map +1 -1
  253. package/esm/sync/types.d.mts +1 -1
  254. package/esm/sync/types.d.mts.map +1 -1
  255. package/esm/types.d.mts +1 -1
  256. package/esm/types.d.mts.map +1 -1
  257. package/esm/utils/connect-to-database.d.mts +1 -1
  258. package/esm/utils/connect-to-database.d.mts.map +1 -1
  259. package/esm/utils/connect-to-database.mjs +1 -1
  260. package/esm/utils/connect-to-database.mjs.map +1 -1
  261. package/esm/utils/database-writer.utils.d.mts +1 -1
  262. package/esm/utils/database-writer.utils.d.mts.map +1 -1
  263. package/esm/utils/database-writer.utils.mjs +1 -1
  264. package/esm/utils/database-writer.utils.mjs.map +1 -1
  265. package/esm/utils/define-model.d.mts +1 -1
  266. package/esm/utils/define-model.d.mts.map +1 -1
  267. package/esm/utils/define-model.mjs +1 -1
  268. package/esm/utils/define-model.mjs.map +1 -1
  269. package/esm/utils/is-valid-date-value.mjs +1 -1
  270. package/esm/utils/is-valid-date-value.mjs.map +1 -1
  271. package/esm/utils/once-connected.d.mts +1 -1
  272. package/esm/utils/once-connected.d.mts.map +1 -1
  273. package/esm/utils/once-connected.mjs +1 -1
  274. package/esm/utils/once-connected.mjs.map +1 -1
  275. package/esm/validation/database-seal-plugins.mjs +1 -1
  276. package/esm/validation/database-seal-plugins.mjs.map +1 -1
  277. package/esm/validation/database-writer-validation-error.d.mts +1 -1
  278. package/esm/validation/database-writer-validation-error.d.mts.map +1 -1
  279. package/esm/validation/database-writer-validation-error.mjs +1 -1
  280. package/esm/validation/database-writer-validation-error.mjs.map +1 -1
  281. package/esm/validation/mutators/embed-mutator.mjs +1 -1
  282. package/esm/validation/mutators/embed-mutator.mjs.map +1 -1
  283. package/esm/validation/plugins/database-rules-plugin.d.mts +1 -1
  284. package/esm/validation/plugins/database-rules-plugin.d.mts.map +1 -1
  285. package/esm/validation/plugins/database-rules-plugin.mjs +1 -1
  286. package/esm/validation/plugins/database-rules-plugin.mjs.map +1 -1
  287. package/esm/validation/plugins/embed-validator-plugin.d.mts +1 -1
  288. package/esm/validation/plugins/embed-validator-plugin.d.mts.map +1 -1
  289. package/esm/validation/plugins/embed-validator-plugin.mjs +1 -1
  290. package/esm/validation/plugins/embed-validator-plugin.mjs.map +1 -1
  291. package/esm/validation/rules/database-model-rule.mjs +1 -1
  292. package/esm/validation/rules/database-model-rule.mjs.map +1 -1
  293. package/esm/validation/rules/exists-rule.mjs +1 -1
  294. package/esm/validation/rules/exists-rule.mjs.map +1 -1
  295. package/esm/validation/rules/unique-rule.mjs +1 -1
  296. package/esm/validation/rules/unique-rule.mjs.map +1 -1
  297. package/esm/validation/transformers/embed-model-transformer.mjs +1 -1
  298. package/esm/validation/transformers/embed-model-transformer.mjs.map +1 -1
  299. package/esm/validation/types.d.mts +1 -1
  300. package/esm/validation/types.d.mts.map +1 -1
  301. package/esm/validation/validators/embed-validator.d.mts +1 -1
  302. package/esm/validation/validators/embed-validator.d.mts.map +1 -1
  303. package/esm/validation/validators/embed-validator.mjs +1 -1
  304. package/esm/validation/validators/embed-validator.mjs.map +1 -1
  305. package/esm/writer/database-writer.d.mts +1 -1
  306. package/esm/writer/database-writer.d.mts.map +1 -1
  307. package/esm/writer/database-writer.mjs +1 -1
  308. package/esm/writer/database-writer.mjs.map +1 -1
  309. package/llms-full.txt +535 -0
  310. package/llms.txt +1 -0
  311. package/package.json +9 -12
  312. package/skills/README.md +4 -0
  313. package/skills/alter-migration/SKILL.md +531 -0
  314. package/bin/cascade.js +0 -3
  315. package/bin/cascadejs +0 -3
  316. package/esm/cli/commands/migrate-export-sql.mjs +0 -48
  317. package/esm/cli/commands/migrate-export-sql.mjs.map +0 -1
  318. package/esm/cli/commands/migrate-list.mjs +0 -26
  319. package/esm/cli/commands/migrate-list.mjs.map +0 -1
  320. package/esm/cli/commands/migrate-rollback.mjs +0 -50
  321. package/esm/cli/commands/migrate-rollback.mjs.map +0 -1
  322. package/esm/cli/commands/migrate.mjs +0 -65
  323. package/esm/cli/commands/migrate.mjs.map +0 -1
  324. package/esm/cli/connection-from-env.mjs +0 -181
  325. package/esm/cli/connection-from-env.mjs.map +0 -1
  326. package/esm/cli/index.mjs +0 -31
  327. package/esm/cli/index.mjs.map +0 -1
  328. package/esm/cli/load-migrations.mjs +0 -78
  329. package/esm/cli/load-migrations.mjs.map +0 -1
  330. package/esm/cli/printers.mjs +0 -57
  331. package/esm/cli/printers.mjs.map +0 -1
  332. package/esm/cli/setup-logger.mjs +0 -30
  333. package/esm/cli/setup-logger.mjs.map +0 -1
  334. package/esm/cli/with-cli-connection.mjs +0 -39
  335. package/esm/cli/with-cli-connection.mjs.map +0 -1
  336. package/esm/cli.d.mts +0 -1
  337. package/esm/cli.mjs +0 -26
  338. package/esm/cli.mjs.map +0 -1
package/llms-full.txt CHANGED
@@ -110,6 +110,541 @@ The `orderBy` reference matches the alias from the aggregates object.
110
110
  - [`@warlock.js/cache/use-cached-hof/SKILL.md`](@warlock.js/cache/use-cached-hof/SKILL.md) — caching expensive aggregate results
111
111
 
112
112
 
113
+ ## alter-migration `@warlock.js/cascade/alter-migration/SKILL.md`
114
+
115
+ ---
116
+ name: alter-migration
117
+ description: 'Evolve an existing table with `Migration.alter(Model, schema, options?)` — add/drop/rename/modify columns; add/drop regular, unique, expression, full-text, geo, vector, and TTL indexes; add/drop foreign keys and CHECK constraints; write rollbacks with class-form methods in `down()`. Triggers: "alter a table", "add a column to existing table", "drop a column", "rename a column", "add an index", "drop a unique constraint", "change a column type", `Migration.alter`, `dropUnique`, `addIndex`, `addForeign`. Skip: creating a brand-new table — `@warlock.js/cascade/write-migration/SKILL.md`.'
118
+ ---
119
+
120
+ # Alter a migration
121
+
122
+ Use `Migration.alter` to evolve an existing table — adding or dropping columns, renaming them, changing their type, and managing every variety of index or constraint. It's the declarative counterpart to `Migration.create` and inherits the table name and data source straight from the model.
123
+
124
+ > **Key difference from `Migration.create`:** `alter` does **not** auto-infer rollbacks. You must supply a `down()` function in options whenever you need to be able to roll back.
125
+
126
+ ---
127
+
128
+ ## Minimal example
129
+
130
+ ```ts title="src/app/users/models/user/migrations/06-09-2026_00-00-00-add-phone-to-users.migration.ts"
131
+ import { Migration, text } from "@warlock.js/cascade";
132
+ import { User } from "../user.model";
133
+
134
+ export default Migration.alter(User, {
135
+ add: {
136
+ phone: text().nullable(),
137
+ },
138
+ }, {
139
+ down() {
140
+ this.dropColumn("phone");
141
+ },
142
+ });
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Signature
148
+
149
+ ```ts
150
+ Migration.alter(
151
+ model: ModelClass,
152
+ schema: AlterSchema,
153
+ options?: MigrationAlterOptions,
154
+ ): MigrationConstructor
155
+ ```
156
+
157
+ - **`model`** — the model class; provides `table` and `dataSource` automatically.
158
+ - **`schema`** — any combination of the keys below; omit everything you don't need.
159
+ - **`options`** — rollback logic + order/transaction overrides (see [Options](#options)).
160
+
161
+ ---
162
+
163
+ ## Column operations
164
+
165
+ ### `add` — new columns
166
+
167
+ ```ts
168
+ import { Migration, text, integer, bool, uuid } from "@warlock.js/cascade";
169
+ import { Organization } from "app/organizations/models/organization";
170
+ import { User } from "../user.model";
171
+
172
+ export default Migration.alter(User, {
173
+ add: {
174
+ phone: text().nullable(),
175
+ login_attempts: integer().notNullable().default(0),
176
+ is_verified: bool().notNullable().default(false),
177
+ organization_id: uuid().references(Organization.table).onDelete("cascade").notNullable(),
178
+ },
179
+ }, {
180
+ down() {
181
+ this.dropColumn("phone");
182
+ this.dropColumn("login_attempts");
183
+ this.dropColumn("is_verified");
184
+ this.dropColumn("organization_id");
185
+ },
186
+ });
187
+ ```
188
+
189
+ Column helpers (`text`, `integer`, `bool`, `uuid`, `double`, `json`, `timestamp`, `date`, …) are imported from `@warlock.js/cascade` and support the same modifier chain as in `Migration.create`.
190
+
191
+ ### `drop` — remove columns
192
+
193
+ ```ts
194
+ export default Migration.alter(User, {
195
+ drop: ["legacy_token", "old_avatar_url"],
196
+ }, {
197
+ down() {
198
+ // re-add with the original definition if rollback is meaningful
199
+ this.text("legacy_token").nullable();
200
+ this.text("old_avatar_url").nullable();
201
+ },
202
+ });
203
+ ```
204
+
205
+ ### `rename` — rename columns
206
+
207
+ ```ts
208
+ export default Migration.alter(Post, {
209
+ rename: {
210
+ body: "content",
211
+ thumb_url: "thumbnail_url",
212
+ },
213
+ }, {
214
+ down() {
215
+ this.renameColumn("content", "body");
216
+ this.renameColumn("thumbnail_url", "thumb_url");
217
+ },
218
+ });
219
+ ```
220
+
221
+ ### `modify` — change column type or nullability
222
+
223
+ ```ts
224
+ import { Migration, string } from "@warlock.js/cascade";
225
+ import { User } from "../user.model";
226
+
227
+ export default Migration.alter(User, {
228
+ modify: {
229
+ // widen email from text to varchar(320) and keep not-null
230
+ email: string(320).notNullable(),
231
+ },
232
+ }, {
233
+ down() {
234
+ // revert to unbounded text
235
+ this.text("email").notNullable();
236
+ },
237
+ });
238
+ ```
239
+
240
+ > `modify` re-declares the column. Include every modifier you want to keep (`.notNullable()`, `.default(…)`, etc.) — the declaration replaces the old one entirely.
241
+
242
+ ---
243
+
244
+ ## Index operations
245
+
246
+ ### Regular indexes — `addIndex` / `dropIndex`
247
+
248
+ ```ts
249
+ export default Migration.alter(Order, {
250
+ // single column
251
+ addIndex: [{ columns: "status" }],
252
+ }, {
253
+ down() {
254
+ this.dropIndex("status");
255
+ },
256
+ });
257
+ ```
258
+
259
+ ```ts
260
+ // composite index with an explicit name
261
+ export default Migration.alter(Order, {
262
+ addIndex: [
263
+ { columns: ["organization_id", "status"], name: "idx_org_status" },
264
+ { columns: "created_at" },
265
+ ],
266
+ }, {
267
+ down() {
268
+ this.dropIndex("idx_org_status");
269
+ this.dropIndex("created_at");
270
+ },
271
+ });
272
+ ```
273
+
274
+ `dropIndex` accepts a name string or a columns array:
275
+
276
+ ```ts
277
+ export default Migration.alter(Order, {
278
+ dropIndex: ["idx_org_status", ["created_at"]],
279
+ });
280
+ ```
281
+
282
+ `options.concurrently: true` builds the index without locking the table (Postgres):
283
+
284
+ ```ts
285
+ addIndex: [{ columns: "email", options: { concurrently: true } }]
286
+ ```
287
+
288
+ ### Unique constraints — `addUnique` / `dropUnique`
289
+
290
+ ```ts
291
+ // promote an indexed column to unique
292
+ export default Migration.alter(User, {
293
+ addUnique: [{ columns: "email" }],
294
+ }, {
295
+ down() {
296
+ this.dropUnique("email");
297
+ },
298
+ });
299
+ ```
300
+
301
+ Composite unique constraint:
302
+
303
+ ```ts
304
+ export default Migration.alter(Membership, {
305
+ addUnique: [{ columns: ["organization_id", "user_id"], name: "uq_org_member" }],
306
+ }, {
307
+ down() {
308
+ this.dropUnique(["organization_id", "user_id"]);
309
+ },
310
+ });
311
+ ```
312
+
313
+ Downgrade a unique to a plain index (the pattern used in this session):
314
+
315
+ ```ts
316
+ export default Migration.alter(User, {
317
+ dropUnique: [["email"]],
318
+ addIndex: [{ columns: "email", name: "users_email_index" }],
319
+ }, {
320
+ down() {
321
+ this.dropIndex("users_email_index");
322
+ this.unique("email");
323
+ },
324
+ });
325
+ ```
326
+
327
+ ### Expression indexes — `addExpressionIndex` (Postgres)
328
+
329
+ ```ts
330
+ export default Migration.alter(User, {
331
+ addExpressionIndex: [
332
+ { expressions: "lower(email)", name: "idx_email_ci" },
333
+ { expressions: "lower(name)", name: "idx_name_ci" },
334
+ { expressions: ["year(created_at)", "status"] },
335
+ ],
336
+ }, {
337
+ down() {
338
+ this.dropIndex("idx_email_ci");
339
+ this.dropIndex("idx_name_ci");
340
+ },
341
+ });
342
+ ```
343
+
344
+ ---
345
+
346
+ ## Specialized indexes
347
+
348
+ ### Full-text — `addFullText` / `dropFullText`
349
+
350
+ ```ts
351
+ export default Migration.alter(Article, {
352
+ addFullText: [
353
+ {
354
+ columns: ["title", "body"],
355
+ options: { name: "ft_article_search", language: "english" },
356
+ },
357
+ ],
358
+ }, {
359
+ down() {
360
+ this.dropFullText("ft_article_search");
361
+ },
362
+ });
363
+ ```
364
+
365
+ ### Geo-spatial — `addGeoIndex` / `dropGeoIndex`
366
+
367
+ ```ts
368
+ export default Migration.alter(Store, {
369
+ addGeoIndex: [{ column: "location" }],
370
+ }, {
371
+ down() {
372
+ this.dropGeoIndex("location");
373
+ },
374
+ });
375
+ ```
376
+
377
+ Options: `{ name?, type?: "2dsphere" | "2d", min?, max? }`
378
+
379
+ ### Vector (AI embeddings) — `addVectorIndex` / `dropVectorIndex`
380
+
381
+ ```ts
382
+ export default Migration.alter(Document, {
383
+ addVectorIndex: [{
384
+ column: "embedding",
385
+ options: { dimensions: 1536, similarity: "cosine", name: "idx_doc_embedding" },
386
+ }],
387
+ }, {
388
+ down() {
389
+ this.dropVectorIndex("embedding");
390
+ },
391
+ });
392
+ ```
393
+
394
+ Similarity options: `"cosine"` | `"euclidean"` | `"dotProduct"`.
395
+
396
+ ### TTL (MongoDB) — `addTTLIndex` / `dropTTLIndex`
397
+
398
+ Expires documents automatically after a fixed duration:
399
+
400
+ ```ts
401
+ export default Migration.alter(Session, {
402
+ addTTLIndex: [{ column: "created_at", expireAfterSeconds: 86400 }], // 24 h
403
+ }, {
404
+ down() {
405
+ this.dropTTLIndex("created_at");
406
+ },
407
+ });
408
+ ```
409
+
410
+ ---
411
+
412
+ ## Constraints
413
+
414
+ ### Foreign keys — `addForeign` / `dropForeign`
415
+
416
+ Pass a model class or a raw table-name string for `references`:
417
+
418
+ ```ts
419
+ import { Migration } from "@warlock.js/cascade";
420
+ import { Team } from "app/teams/models/team";
421
+ import { User } from "../user.model";
422
+
423
+ export default Migration.alter(User, {
424
+ addForeign: [
425
+ { column: "team_id", references: Team, onDelete: "cascade" },
426
+ { column: "owner_id", references: "users", on: "id", onDelete: "setNull" },
427
+ ],
428
+ }, {
429
+ down() {
430
+ this.dropForeign("team_id", Team.table);
431
+ this.dropForeign("owner_id", "users");
432
+ },
433
+ });
434
+ ```
435
+
436
+ `onDelete` / `onUpdate` values: `"cascade"` | `"restrict"` | `"setNull"` | `"noAction"`. Both default to `"restrict"` when omitted.
437
+
438
+ Drop by constraint name when you named it manually:
439
+
440
+ ```ts
441
+ dropForeign: [{ columnOrConstraint: "fk_my_custom_name" }]
442
+ ```
443
+
444
+ ### CHECK constraints — `addCheck` / `dropCheck`
445
+
446
+ ```ts
447
+ export default Migration.alter(Product, {
448
+ addCheck: [
449
+ { name: "price_positive", expression: "price_cents >= 0" },
450
+ { name: "stock_non_negative", expression: "stock >= 0" },
451
+ ],
452
+ }, {
453
+ down() {
454
+ this.dropCheck("price_positive");
455
+ this.dropCheck("stock_non_negative");
456
+ },
457
+ });
458
+ ```
459
+
460
+ ---
461
+
462
+ ## Raw SQL inside an alter
463
+
464
+ Use `raw` when you need a one-off SQL statement alongside declarative changes (e.g. backfilling a new column in the same migration when the table is small):
465
+
466
+ ```ts
467
+ export default Migration.alter(User, {
468
+ add: {
469
+ full_name: text().nullable(),
470
+ },
471
+ raw: `UPDATE users SET full_name = first_name || ' ' || last_name`,
472
+ }, {
473
+ down() {
474
+ this.dropColumn("full_name");
475
+ },
476
+ });
477
+ ```
478
+
479
+ Pass an array for multiple statements:
480
+
481
+ ```ts
482
+ raw: [
483
+ `UPDATE users SET status = 'active' WHERE status IS NULL`,
484
+ `UPDATE users SET role = 'member' WHERE role IS NULL`,
485
+ ]
486
+ ```
487
+
488
+ ---
489
+
490
+ ## Writing `down()` — the rollback function
491
+
492
+ `Migration.alter` **never** auto-infers rollback. Supply `down()` in options whenever you want `cascade migrate:rollback` to work. Inside `down()`, `this` is a full `Migration` instance — every class-form builder is available:
493
+
494
+ | Operation | Class-form call in `down()` |
495
+ |---|---|
496
+ | Drop an added column | `this.dropColumn("name")` |
497
+ | Re-add a dropped column | `this.text("name").nullable()` |
498
+ | Undo a rename | `this.renameColumn("new", "old")` |
499
+ | Undo a column modify | `this.text("col").notNullable()` |
500
+ | Drop a plain index (by name) | `this.dropIndex("idx_name")` |
501
+ | Drop a plain index (by columns) | `this.dropIndex(["col_a", "col_b"])` |
502
+ | Drop a unique constraint | `this.dropUnique("email")` or `this.dropUnique(["a", "b"])` |
503
+ | Add a unique constraint back | `this.unique("email")` |
504
+ | Add a plain index back | `this.index("email", "idx_name")` |
505
+ | Drop a foreign key | `this.dropForeign("col", "ref_table")` |
506
+ | Drop a CHECK constraint | `this.dropCheck("constraint_name")` |
507
+ | Drop full-text index | `this.dropFullText("ft_name")` |
508
+ | Drop geo index | `this.dropGeoIndex("column")` |
509
+ | Drop vector index | `this.dropVectorIndex("column")` |
510
+ | Drop TTL index | `this.dropTTLIndex("column")` |
511
+ | Raw SQL | `this.raw("SQL statement")` |
512
+
513
+ If a migration is genuinely irreversible, throw inside `down()` so accidental rollbacks fail loudly:
514
+
515
+ ```ts
516
+ {
517
+ down() {
518
+ throw new Error("This migration is irreversible — restore from backup.");
519
+ },
520
+ }
521
+ ```
522
+
523
+ ---
524
+
525
+ ## Options (`MigrationAlterOptions`)
526
+
527
+ | Key | Type | Purpose |
528
+ |---|---|---|
529
+ | `down` | `(this: Migration) => void \| Promise<void>` | Rollback logic (not auto-inferred) |
530
+ | `up` | `(this: Migration) => void \| Promise<void>` | Extra imperative logic to run after declarative changes |
531
+ | `order` | `number` | Execution order override (default `0`) |
532
+ | `createdAt` | `string` | ISO timestamp override for migration name ordering |
533
+ | `transactional` | `boolean` | Wrap the migration in a DB transaction |
534
+
535
+ The `up` hook runs **after** the declarative schema changes, making it useful for data backfills or conditional DDL that depends on the added schema:
536
+
537
+ ```ts
538
+ export default Migration.alter(User, {
539
+ add: { verified_at: timestamp().nullable() },
540
+ }, {
541
+ up() {
542
+ // backfill: mark existing confirmed users as verified
543
+ this.raw(`UPDATE users SET verified_at = updated_at WHERE status = 'confirmed'`);
544
+ },
545
+ down() {
546
+ this.dropColumn("verified_at");
547
+ },
548
+ });
549
+ ```
550
+
551
+ ---
552
+
553
+ ## Common recipes
554
+
555
+ ### Add a column + foreign key together
556
+
557
+ ```ts
558
+ import { Migration, uuid } from "@warlock.js/cascade";
559
+ import { Team } from "app/teams/models/team";
560
+ import { User } from "../user.model";
561
+
562
+ export default Migration.alter(User, {
563
+ add: {
564
+ team_id: uuid().nullable(),
565
+ },
566
+ addForeign: [
567
+ { column: "team_id", references: Team, onDelete: "setNull" },
568
+ ],
569
+ addIndex: [{ columns: "team_id" }],
570
+ }, {
571
+ down() {
572
+ this.dropForeign("team_id", Team.table);
573
+ this.dropIndex("team_id");
574
+ this.dropColumn("team_id");
575
+ },
576
+ });
577
+ ```
578
+
579
+ ### Swap unique → plain index
580
+
581
+ ```ts
582
+ export default Migration.alter(User, {
583
+ dropUnique: [["email"]],
584
+ addIndex: [{ columns: "email", name: "users_email_index" }],
585
+ }, {
586
+ down() {
587
+ this.dropIndex("users_email_index");
588
+ this.unique("email");
589
+ },
590
+ });
591
+ ```
592
+
593
+ ### Rename + widen a column
594
+
595
+ ```ts
596
+ export default Migration.alter(Post, {
597
+ rename: { body: "content" },
598
+ modify: { content: text().notNullable() },
599
+ }, {
600
+ down() {
601
+ this.renameColumn("content", "body");
602
+ },
603
+ });
604
+ ```
605
+
606
+ ### Multiple operations in one migration
607
+
608
+ Combine freely — all operations run in a single `up()` call:
609
+
610
+ ```ts
611
+ export default Migration.alter(Product, {
612
+ add: { sku: text().unique().notNullable() },
613
+ drop: ["old_code"],
614
+ rename: { price: "price_cents" },
615
+ modify: { price_cents: integer().notNullable() },
616
+ addIndex: [{ columns: ["category_id", "status"], name: "idx_cat_status" }],
617
+ addCheck: [{ name: "price_non_negative", expression: "price_cents >= 0" }],
618
+ }, {
619
+ down() {
620
+ this.dropCheck("price_non_negative");
621
+ this.dropIndex("idx_cat_status");
622
+ this.renameColumn("price_cents", "price");
623
+ this.text("old_code").nullable();
624
+ this.dropColumn("sku");
625
+ },
626
+ });
627
+ ```
628
+
629
+ ---
630
+
631
+ ## Things NOT to do
632
+
633
+ - **Don't edit a shipped migration.** If it's already run in any environment, add a new migration on top.
634
+ - **Don't skip `down()` for reversible changes.** Without it, `cascade migrate:rollback` is a no-op on your migration.
635
+ - **Don't put large backfills and schema changes together.** Schema change first (nullable column or default), backfill second — in its own migration or a background job. This keeps rollback safe.
636
+ - **Don't use `raw` for something the declarative API already covers.** Use `addIndex`, `addUnique`, etc. — raw SQL bypasses Cascade's driver abstraction and breaks on non-Postgres sources.
637
+ - **Don't declare `id`, `createdAt`, or `updatedAt`** — they're managed by the framework.
638
+
639
+ ---
640
+
641
+ ## See also
642
+
643
+ - [`@warlock.js/cascade/write-migration/SKILL.md`](@warlock.js/cascade/write-migration/SKILL.md) — `Migration.create` for brand-new tables + all column helpers
644
+ - [`@warlock.js/cascade/run-cascade-cli/SKILL.md`](@warlock.js/cascade/run-cascade-cli/SKILL.md) — CLI flags + programmatic Operations API
645
+ - [`@warlock.js/cascade/manage-data-sources/SKILL.md`](@warlock.js/cascade/manage-data-sources/SKILL.md) — multi-DB migrations
646
+
647
+
113
648
  ## cascade-basics `@warlock.js/cascade/cascade-basics/SKILL.md`
114
649
 
115
650
  ---
package/llms.txt CHANGED
@@ -7,6 +7,7 @@
7
7
  ## Skills
8
8
 
9
9
  - [aggregate-data](@warlock.js/cascade/aggregate-data/SKILL.md): Compute aggregates over a query — scalar `.count()` / `.sum(field)` / `.avg` / `.min` / `.max`, plus grouped rollups via the two-arg `.groupBy(fields, { alias: $agg.* })` with the `$agg` helpers and `.having(alias, op, value)` on computed aggregates. Triggers: `.count`, `.sum`, `.avg`, `.min`, `.max`, `.groupBy`, `.having`, `$agg`, `$agg.sum`, `$agg.count`; "monthly revenue report", "X per category", "group by status", "dashboard rollup"; typical import `import { Model, $agg } from "@warlock.js/cascade"`. Skip: row queries — `@warlock.js/cascade/query-data/SKILL.md`; cached aggregates — `@warlock.js/cache/use-cached-hof/SKILL.md`; competing tools raw SQL `GROUP BY`, `mongoose aggregate`, `prisma` `groupBy`.
10
+ - [alter-migration](@warlock.js/cascade/alter-migration/SKILL.md): Evolve an existing table with `Migration.alter(Model, schema, options?)` — add/drop/rename/modify columns; add/drop regular, unique, expression, full-text, geo, vector, and TTL indexes; add/drop foreign keys and CHECK constraints; write rollbacks with class-form methods in `down()`. Triggers: "alter a table", "add a column to existing table", "drop a column", "rename a column", "add an index", "drop a unique constraint", "change a column type", `Migration.alter`, `dropUnique`, `addIndex`, `addForeign`. Skip: creating a brand-new table — `@warlock.js/cascade/write-migration/SKILL.md`.
10
11
  - [cascade-basics](@warlock.js/cascade/cascade-basics/SKILL.md): Start with @warlock.js/cascade ORM — model-first for MongoDB and Postgres, one schema (seal) does triple duty (type / validator / DB shape), model is the query entry point. Triggers: `Model`, `RegisterModel`, `connectToDatabase`, `Infer`, `v.object`; "which cascade skill do I need", "set up the ORM", "define my first model", "model-first ORM"; typical import `import { Model, RegisterModel } from "@warlock.js/cascade"`. Skip: schema vocabulary — `@warlock.js/seal/seal-basics/SKILL.md`; competing libs `mongoose`, `prisma`, `typeorm`, `drizzle`, `sequelize`, `mongodb` driver, `knex`.
11
12
  - [configure-delete-strategy](@warlock.js/cascade/configure-delete-strategy/SKILL.md): Pick the delete behavior — `permanent` (hard delete), `soft` (set `deletedAt`, keep the row), `trash` (move to a separate table). Configure via `static deleteStrategy` or `.destroy({ strategy })`; restore via static `Model.restore(id)` / `Model.restoreAll()`. Triggers: `static deleteStrategy`, `.destroy`, `Model.restore`, `Model.restoreAll`, `deletedAtColumn`, `trashTable`; "soft delete users", "restore a deleted record", "GDPR hard delete"; typical import `import { Model } from "@warlock.js/cascade"`. Skip: lifecycle events — `@warlock.js/cascade/subscribe-to-model-events/SKILL.md`; competing libs `mongoose-delete`, `typeorm softRemove`, `sequelize` paranoid.
12
13
  - [define-model](@warlock.js/cascade/define-model/SKILL.md): Define a Cascade model — `@RegisterModel()`, class extends `Model<TSchema>`, `static table`, `static schema`, three update idioms (`.set` / `.merge` / `.save`), `.unset`, `.destroy`, `static toJsonColumns` / `resource` for output shaping. Triggers: `Model`, `RegisterModel`, `static schema`, `.set`, `.merge`, `.save`, `.unset`, `.destroy`, `toJsonColumns`, `resource`; "how do I define a model", "shape the JSON output", "remove a field"; typical import `import { Model, RegisterModel } from "@warlock.js/cascade"`. Skip: querying — `@warlock.js/cascade/query-data/SKILL.md`; relations — `@warlock.js/cascade/define-relations/SKILL.md`; competing libs `mongoose`, `prisma`, `typeorm` `@Entity`.
package/package.json CHANGED
@@ -27,9 +27,9 @@
27
27
  "@mongez/events": "^2.2.6",
28
28
  "@mongez/reinforcements": "^3.2.0",
29
29
  "@mongez/supportive-is": "^2.1.3",
30
- "@warlock.js/context": "4.1.15",
31
- "@warlock.js/logger": "4.1.15",
32
- "@warlock.js/seal": "4.1.15",
30
+ "@warlock.js/context": "4.2.0",
31
+ "@warlock.js/logger": "4.2.0",
32
+ "@warlock.js/seal": "4.2.0",
33
33
  "citty": "^0.2.2",
34
34
  "fast-glob": "^3.3.3"
35
35
  },
@@ -40,9 +40,8 @@
40
40
  "bin": {
41
41
  "cascade": "bin/cascade.js"
42
42
  },
43
- "version": "4.1.15",
44
- "type": "module",
45
- "main": "./esm/index.mjs",
43
+ "version": "4.2.0",
44
+ "main": "./cjs/index.cjs",
46
45
  "module": "./esm/index.mjs",
47
46
  "types": "./esm/index.d.mts",
48
47
  "exports": {
@@ -50,12 +49,10 @@
50
49
  "import": {
51
50
  "types": "./esm/index.d.mts",
52
51
  "default": "./esm/index.mjs"
53
- }
54
- },
55
- "./cli": {
56
- "import": {
57
- "types": "./esm/cli.d.mts",
58
- "default": "./esm/cli.mjs"
52
+ },
53
+ "require": {
54
+ "types": "./esm/index.d.mts",
55
+ "default": "./cjs/index.cjs"
59
56
  }
60
57
  }
61
58
  }
package/skills/README.md CHANGED
@@ -4,6 +4,10 @@ Per-task skills. All cross-references use the form `@warlock.js/<pkg>/<skill>/SK
4
4
 
5
5
  ## Skills
6
6
 
7
+ ### [`alter-migration/`](./alter-migration/SKILL.md)
8
+
9
+ Evolve an existing table with `Migration.alter(Model, schema, options?)` — add/drop/rename/modify columns; add/drop regular, unique, expression, full-text, geo, vector, and TTL indexes; add/drop foreign keys and CHECK constraints; write rollbacks with class-form methods in `down()`. Load when changing an existing table — adding columns, swapping unique→index, wiring new foreign keys, or any DDL that's not creating a brand-new table.
10
+
7
11
  ### [`aggregate-data/`](./aggregate-data/SKILL.md)
8
12
 
9
13
  Compute aggregates over a query — `.count()`, `.sum(field)`, `.avg`, `.min`, `.max`, plus the two-arg `.groupBy(fields, { alias: $agg.* })` + `.having` for group-level rollups. Load when building reports, dashboards, 'X per category' rollups, or any query returning numbers rather than rows.