@rvoh/dream 2.0.1 → 2.0.2

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 (175) hide show
  1. package/CHANGELOG.md +311 -0
  2. package/docs/classes/db.DreamMigrationHelpers.html +9 -9
  3. package/docs/classes/db.KyselyQueryDriver.html +30 -30
  4. package/docs/classes/db.PostgresQueryDriver.html +31 -31
  5. package/docs/classes/db.QueryDriverBase.html +29 -29
  6. package/docs/classes/errors.CheckConstraintViolation.html +3 -3
  7. package/docs/classes/errors.ColumnOverflow.html +3 -3
  8. package/docs/classes/errors.CreateOrFindByFailedToCreateAndFind.html +3 -3
  9. package/docs/classes/errors.DataIncompatibleWithDatabaseField.html +3 -3
  10. package/docs/classes/errors.DataTypeColumnTypeMismatch.html +3 -3
  11. package/docs/classes/errors.GlobalNameNotSet.html +3 -3
  12. package/docs/classes/errors.InvalidCalendarDate.html +2 -2
  13. package/docs/classes/errors.MissingSerializersDefinition.html +3 -3
  14. package/docs/classes/errors.NonLoadedAssociation.html +3 -3
  15. package/docs/classes/errors.NotNullViolation.html +3 -3
  16. package/docs/classes/errors.RecordNotFound.html +3 -3
  17. package/docs/classes/errors.ValidationError.html +3 -3
  18. package/docs/classes/index.CalendarDate.html +2 -2
  19. package/docs/classes/index.Decorators.html +19 -19
  20. package/docs/classes/index.Dream.html +113 -113
  21. package/docs/classes/index.DreamApp.html +5 -5
  22. package/docs/classes/index.DreamTransaction.html +2 -2
  23. package/docs/classes/index.Env.html +2 -2
  24. package/docs/classes/index.Query.html +53 -53
  25. package/docs/classes/system.CliFileWriter.html +2 -2
  26. package/docs/classes/system.DreamBin.html +2 -2
  27. package/docs/classes/system.DreamCLI.html +5 -5
  28. package/docs/classes/system.DreamImporter.html +2 -2
  29. package/docs/classes/system.DreamLogos.html +2 -2
  30. package/docs/classes/system.DreamSerializerBuilder.html +8 -8
  31. package/docs/classes/system.ObjectSerializerBuilder.html +8 -8
  32. package/docs/classes/utils.Encrypt.html +2 -2
  33. package/docs/classes/utils.Range.html +2 -2
  34. package/docs/functions/db.closeAllDbConnections.html +1 -1
  35. package/docs/functions/db.dreamDbConnections.html +1 -1
  36. package/docs/functions/db.untypedDb.html +1 -1
  37. package/docs/functions/db.validateColumn.html +1 -1
  38. package/docs/functions/db.validateTable.html +1 -1
  39. package/docs/functions/errors.pgErrorType.html +1 -1
  40. package/docs/functions/index.DreamSerializer.html +1 -1
  41. package/docs/functions/index.ObjectSerializer.html +1 -1
  42. package/docs/functions/index.ReplicaSafe.html +1 -1
  43. package/docs/functions/index.STI.html +1 -1
  44. package/docs/functions/index.SoftDelete.html +1 -1
  45. package/docs/functions/utils.camelize.html +1 -1
  46. package/docs/functions/utils.capitalize.html +1 -1
  47. package/docs/functions/utils.cloneDeepSafe.html +1 -1
  48. package/docs/functions/utils.compact.html +1 -1
  49. package/docs/functions/utils.groupBy.html +1 -1
  50. package/docs/functions/utils.hyphenize.html +1 -1
  51. package/docs/functions/utils.intersection.html +1 -1
  52. package/docs/functions/utils.isEmpty.html +1 -1
  53. package/docs/functions/utils.normalizeUnicode.html +1 -1
  54. package/docs/functions/utils.pascalize.html +1 -1
  55. package/docs/functions/utils.percent.html +1 -1
  56. package/docs/functions/utils.range-1.html +1 -1
  57. package/docs/functions/utils.round.html +1 -1
  58. package/docs/functions/utils.sanitizeString.html +1 -1
  59. package/docs/functions/utils.snakeify.html +1 -1
  60. package/docs/functions/utils.sort.html +1 -1
  61. package/docs/functions/utils.sortBy.html +1 -1
  62. package/docs/functions/utils.sortObjectByKey.html +1 -1
  63. package/docs/functions/utils.sortObjectByValue.html +1 -1
  64. package/docs/functions/utils.uncapitalize.html +1 -1
  65. package/docs/functions/utils.uniq.html +1 -1
  66. package/docs/interfaces/openapi.OpenapiDescription.html +2 -2
  67. package/docs/interfaces/openapi.OpenapiSchemaProperties.html +1 -1
  68. package/docs/interfaces/openapi.OpenapiSchemaPropertiesShorthand.html +1 -1
  69. package/docs/interfaces/openapi.OpenapiTypeFieldObject.html +1 -1
  70. package/docs/interfaces/types.BelongsToStatement.html +2 -2
  71. package/docs/interfaces/types.DecoratorContext.html +2 -2
  72. package/docs/interfaces/types.DreamAppInitOptions.html +2 -2
  73. package/docs/interfaces/types.DreamAppOpts.html +2 -2
  74. package/docs/interfaces/types.EncryptOptions.html +2 -2
  75. package/docs/interfaces/types.InternalAnyTypedSerializerRendersMany.html +2 -2
  76. package/docs/interfaces/types.InternalAnyTypedSerializerRendersOne.html +2 -2
  77. package/docs/interfaces/types.SerializerRendererOpts.html +2 -2
  78. package/docs/modules/db.html +1 -1
  79. package/docs/modules/errors.html +1 -1
  80. package/docs/modules/index.html +1 -1
  81. package/docs/modules/openapi.html +1 -1
  82. package/docs/modules/system.html +1 -1
  83. package/docs/modules/types.html +1 -1
  84. package/docs/modules/utils.html +1 -1
  85. package/docs/types/index.DateTime.html +1 -1
  86. package/docs/types/openapi.CommonOpenapiSchemaObjectFields.html +1 -1
  87. package/docs/types/openapi.OpenapiAllTypes.html +1 -1
  88. package/docs/types/openapi.OpenapiFormats.html +1 -1
  89. package/docs/types/openapi.OpenapiNumberFormats.html +1 -1
  90. package/docs/types/openapi.OpenapiPrimitiveBaseTypes.html +1 -1
  91. package/docs/types/openapi.OpenapiPrimitiveTypes.html +1 -1
  92. package/docs/types/openapi.OpenapiSchemaArray.html +1 -1
  93. package/docs/types/openapi.OpenapiSchemaArrayShorthand.html +1 -1
  94. package/docs/types/openapi.OpenapiSchemaBase.html +1 -1
  95. package/docs/types/openapi.OpenapiSchemaBody.html +1 -1
  96. package/docs/types/openapi.OpenapiSchemaBodyShorthand.html +1 -1
  97. package/docs/types/openapi.OpenapiSchemaCommonFields.html +1 -1
  98. package/docs/types/openapi.OpenapiSchemaExpressionAllOf.html +1 -1
  99. package/docs/types/openapi.OpenapiSchemaExpressionAnyOf.html +1 -1
  100. package/docs/types/openapi.OpenapiSchemaExpressionOneOf.html +1 -1
  101. package/docs/types/openapi.OpenapiSchemaExpressionRef.html +1 -1
  102. package/docs/types/openapi.OpenapiSchemaExpressionRefSchemaShorthand.html +1 -1
  103. package/docs/types/openapi.OpenapiSchemaInteger.html +1 -1
  104. package/docs/types/openapi.OpenapiSchemaNull.html +1 -1
  105. package/docs/types/openapi.OpenapiSchemaNumber.html +1 -1
  106. package/docs/types/openapi.OpenapiSchemaObject.html +1 -1
  107. package/docs/types/openapi.OpenapiSchemaObjectAllOf.html +1 -1
  108. package/docs/types/openapi.OpenapiSchemaObjectAllOfShorthand.html +1 -1
  109. package/docs/types/openapi.OpenapiSchemaObjectAnyOf.html +1 -1
  110. package/docs/types/openapi.OpenapiSchemaObjectAnyOfShorthand.html +1 -1
  111. package/docs/types/openapi.OpenapiSchemaObjectBase.html +1 -1
  112. package/docs/types/openapi.OpenapiSchemaObjectBaseShorthand.html +1 -1
  113. package/docs/types/openapi.OpenapiSchemaObjectOneOf.html +1 -1
  114. package/docs/types/openapi.OpenapiSchemaObjectOneOfShorthand.html +1 -1
  115. package/docs/types/openapi.OpenapiSchemaObjectShorthand.html +1 -1
  116. package/docs/types/openapi.OpenapiSchemaPrimitiveGeneric.html +1 -1
  117. package/docs/types/openapi.OpenapiSchemaShorthandExpressionAllOf.html +1 -1
  118. package/docs/types/openapi.OpenapiSchemaShorthandExpressionAnyOf.html +1 -1
  119. package/docs/types/openapi.OpenapiSchemaShorthandExpressionOneOf.html +1 -1
  120. package/docs/types/openapi.OpenapiSchemaShorthandExpressionSerializableRef.html +1 -1
  121. package/docs/types/openapi.OpenapiSchemaShorthandExpressionSerializerRef.html +1 -1
  122. package/docs/types/openapi.OpenapiSchemaShorthandPrimitiveGeneric.html +1 -1
  123. package/docs/types/openapi.OpenapiSchemaString.html +1 -1
  124. package/docs/types/openapi.OpenapiShorthandAllTypes.html +1 -1
  125. package/docs/types/openapi.OpenapiShorthandPrimitiveBaseTypes.html +1 -1
  126. package/docs/types/openapi.OpenapiShorthandPrimitiveTypes.html +1 -1
  127. package/docs/types/openapi.OpenapiTypeField.html +1 -1
  128. package/docs/types/system.DreamAppAllowedPackageManagersEnum.html +1 -1
  129. package/docs/types/types.Camelized.html +1 -1
  130. package/docs/types/types.DbConnectionType.html +1 -1
  131. package/docs/types/types.DbTypes.html +1 -1
  132. package/docs/types/types.DreamAssociationMetadata.html +1 -1
  133. package/docs/types/types.DreamAttributes.html +1 -1
  134. package/docs/types/types.DreamClassAssociationAndStatement.html +1 -1
  135. package/docs/types/types.DreamClassColumn.html +1 -1
  136. package/docs/types/types.DreamColumn.html +1 -1
  137. package/docs/types/types.DreamColumnNames.html +1 -1
  138. package/docs/types/types.DreamLogLevel.html +1 -1
  139. package/docs/types/types.DreamLogger.html +1 -1
  140. package/docs/types/types.DreamModelSerializerType.html +1 -1
  141. package/docs/types/types.DreamOrViewModelClassSerializerKey.html +1 -1
  142. package/docs/types/types.DreamOrViewModelSerializerKey.html +1 -1
  143. package/docs/types/types.DreamParamSafeAttributes.html +1 -1
  144. package/docs/types/types.DreamParamSafeColumnNames.html +1 -1
  145. package/docs/types/types.DreamSerializable.html +1 -1
  146. package/docs/types/types.DreamSerializableArray.html +1 -1
  147. package/docs/types/types.DreamSerializerKey.html +1 -1
  148. package/docs/types/types.DreamSerializers.html +1 -1
  149. package/docs/types/types.DreamVirtualColumns.html +1 -1
  150. package/docs/types/types.EncryptAlgorithm.html +1 -1
  151. package/docs/types/types.HasManyStatement.html +1 -1
  152. package/docs/types/types.HasOneStatement.html +1 -1
  153. package/docs/types/types.Hyphenized.html +1 -1
  154. package/docs/types/types.Pascalized.html +1 -1
  155. package/docs/types/types.RoundingPrecision.html +1 -1
  156. package/docs/types/types.SerializerCasing.html +1 -1
  157. package/docs/types/types.SimpleObjectSerializerType.html +1 -1
  158. package/docs/types/types.Snakeified.html +1 -1
  159. package/docs/types/types.StrictInterface.html +1 -1
  160. package/docs/types/types.UpdateableAssociationProperties.html +1 -1
  161. package/docs/types/types.UpdateableProperties.html +1 -1
  162. package/docs/types/types.ValidationType.html +1 -1
  163. package/docs/types/types.ViewModel.html +1 -1
  164. package/docs/types/types.ViewModelClass.html +1 -1
  165. package/docs/types/types.WhereStatementForDream.html +1 -1
  166. package/docs/types/types.WhereStatementForDreamClass.html +1 -1
  167. package/docs/variables/index.DateTime-1.html +1 -1
  168. package/docs/variables/index.DreamConst.html +1 -1
  169. package/docs/variables/index.ops.html +1 -1
  170. package/docs/variables/openapi.openapiPrimitiveTypes-1.html +1 -1
  171. package/docs/variables/openapi.openapiShorthandPrimitiveTypes-1.html +1 -1
  172. package/docs/variables/system.DreamAppAllowedPackageManagersEnumValues.html +1 -1
  173. package/docs/variables/types.TRIGRAM_OPERATORS.html +1 -1
  174. package/docs/variables/types.primaryKeyTypes.html +1 -1
  175. package/package.json +3 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,311 @@
1
+ ## 2.0.2
2
+
3
+ bump glob to close dependabot alerts
4
+
5
+ ## 2.0.1
6
+
7
+ - remove dream-spec-helpers from peer dependencies
8
+
9
+ ## 2.0.0
10
+
11
+ - namespace package exports
12
+ - remove `Benchmark`
13
+ - Remove `leftJoinPreloadFor` and `leftJoinLoadFor`. They were never a good idea since the idea of `preloadFor` is that one doesn't need to pay attention to all the things that need to be preloaded, but in a join situation, this is a recipe for disaster since loading tables in parallel results in a Cartesian product of result rows being
14
+
15
+ ## 1.13.0
16
+
17
+ - generated code uses absolute imports
18
+ - `Virtual` decorator requires OpenAPI shape
19
+ - don't let a null value in a `Sortable` column break future sorts (null may enter via a migration or `skipHooks`)
20
+ - simplify and DRY up Sortable
21
+ - Sortable keeps values within the range 1 to N
22
+ - fix STI child generation with array attributes (arrays can always be initialized to an empty array, so can leverage a regular non-null constraint). E.g:
23
+
24
+ ```
25
+ yarn psy g:sti-child Room/Bedroom extends Room bed_types:enum\[\]:bed_types:twin,bunk,queen,king,cot,sofabed
26
+ ```
27
+
28
+ ## 1.12.0
29
+
30
+ - DateTime and CalendarDate are always valid and throw an error if invalid
31
+
32
+ ## 1.11.0
33
+
34
+ - fix `scrollPaginate` when the column being ordered by is not unique
35
+ - fix `pluck` so it properly omits soft-deleted records
36
+
37
+ ## 1.11.0
38
+
39
+ - `association` and `associationOrFail` handle required and passthrough `and` clauses
40
+ - `association` and `associationOrFail` compatible with transactions
41
+ - `scrollPaginate` Query and static Dream methods
42
+ - remove `paginate` from DreamClassTransactionBuilder
43
+
44
+ ## 1.10.0
45
+
46
+ - bump kysely
47
+ - paginate includes default ordering on id
48
+ - cli command to ensure migrations have been run prior to running specs
49
+ - fix ability to sync when type files don't reflect models
50
+ - leverage Map instead of an object so don't need to prefix numeric keys with underscore to prevent them from being sorted by numeric value rather than by the order in which they were added to the map
51
+ - renameTable migration helper
52
+ - the key function passed to `sortBy` may now also return a DateTime, a CalendarDate, or a bigint
53
+ - fix `sort` on bigint arrays
54
+ - `percent` function
55
+ - `association` and `associationOrFail` methods to encapsulate the loaded check or associationQuery ternary pattern
56
+ - generated association name and id for a `belongs_to` association are based on the final part of the model name, not the entire namespace [requires Psychic update for generated resource controllers/specs to generate valid code]
57
+ - [BREAKING] `on` replaces `foreignKey` in association declarations, e.g.:
58
+
59
+ ```
60
+ @deco.HasOne('BalloonLine', { on: 'balloonId' })
61
+ public balloonLine: BalloonLine
62
+ ```
63
+
64
+ - generated migrations include index on foreign key
65
+ - don't require openapi for delegatedType when delegating to an association since we can derive the openapi type automatically [requires Psychic update for proper OpenAPI shape to be generated]
66
+ - fix OpenAPI in generated STI base serializer
67
+
68
+ ## 1.9.4
69
+
70
+ - if `required: false`, leave the property undefined rather than rendering as `null`
71
+
72
+ ## 1.9.3
73
+
74
+ - serializer builder attribute option types allow `required: false`; this will be used by Psychic to omit attributes from the required array in OpenaAPI
75
+
76
+ ## 1.9.2
77
+
78
+ - allow null for ops argument to a where clause on a datetime or date column
79
+
80
+ ## 1.9.1
81
+
82
+ - fix where clause range types to allow mixing of CalendarDate and DateTime between start and end of range
83
+ - DateTime and CalendarDate may be used in ops when comparing against a date or datetime column
84
+
85
+ ## 1.9.0
86
+
87
+ Fix broken param safe type columns so that:
88
+
89
+ 1. polymorphic type fields are excluded from param safe types
90
+ 2. association names are excluded
91
+
92
+ Bumping minor, since it could introduce breaking changes for those reliant on previous param safe behavior.
93
+
94
+ ## 1.8.0
95
+
96
+ - throw ColumnOverflow when saving too long a string / number to a database column
97
+ - make all of these errors extend the same error so Psychic can check a single error type when deciding to return 400
98
+
99
+ ## 1.7.3
100
+
101
+ - remove unnecessary token, now that we are open-sourced
102
+
103
+ ## 1.7.2
104
+
105
+ - fix issue causing generators to generate invalid uuid primary keys
106
+
107
+ ## 1.7.1
108
+
109
+ - fix error when file without default export exists in the models directory hierarchy
110
+
111
+ ## 1.7.0
112
+
113
+ - Remove `Dream#isDreamInstance` and `DreamSerializerBuilder/ObjectSerializerBuilder#isSerializer`
114
+ - Export `MissingSerializersDefinition`
115
+
116
+ ## 1.6.0
117
+
118
+ - Move sanitization to Psychic so it can sanitize to real unicode representations
119
+
120
+ ## 1.5.2
121
+
122
+ - Don't require `openapi` for virtual attributes
123
+ - Fix Sortable with null value in scope column
124
+ - Enable sanitization of serialized attributes
125
+ - Enable `<association>.<column>: null` where statements even when the column can't be null so that queries can be constructed to locate models that don't have a particular association
126
+
127
+ ## 1.5.1
128
+
129
+ Add `DreamMigrationHelpers.newTransaction()` to support explicitly starting a new transaction within a migration.
130
+
131
+ ## 1.5.0
132
+
133
+ - add support for multiple database connections in a single dream application. To take advantage of this new feature, you can do the following:
134
+
135
+ 1. Add a new connection configuration to your conf/dream.ts file, providing it an explicit alternate connection name as the second argument, like so:
136
+
137
+ ```ts
138
+ dreamApp.set('db', 'myAlternateConnection', {
139
+ primary: {
140
+ user: AppEnv.string('DB_USER'),
141
+ password: AppEnv.string('DB_PASSWORD', { optional: !AppEnv.isProduction }),
142
+ host: AppEnv.string('DB_HOST', { optional: true }),
143
+ name: AppEnv.string('ALTERNATE_DB_NAME', { optional: true }),
144
+ port: AppEnv.integer('ALTERNATE_DB_PORT', { optional: true }),
145
+ useSsl: false,
146
+ },
147
+ })
148
+ ```
149
+
150
+ Be sure to add any new environment variables to your .env and .env.test files.
151
+
152
+ 2. Run sync
153
+
154
+ ```sh
155
+ yarn psy sync
156
+ ```
157
+
158
+ 3. add a new application model for your new connection, naming it the name of your connection, pascalized, with the string `ApplicationModel` at the end, like so:
159
+
160
+ ```ts
161
+ // app/models/MyAlternateConnectionApplicationModel.ts
162
+
163
+ import Dream from '../../../src/Dream.js'
164
+ import { DBClass } from '../../types/db.alternateConnection.js'
165
+ import { connectionTypeConfig, schema } from '../../types/dream.alternateConnection.js'
166
+ import { globalTypeConfig } from '../../types/dream.globals.js'
167
+
168
+ export default class MyAlternateConnectionApplicationModel extends Dream {
169
+ declare public DB: DBClass
170
+
171
+ public override get connectionName() {
172
+ return 'alternateConnection' as const
173
+ }
174
+
175
+ public override get schema(): any {
176
+ return schema
177
+ }
178
+
179
+ public override get connectionTypeConfig() {
180
+ return connectionTypeConfig
181
+ }
182
+
183
+ public override get globalTypeConfig() {
184
+ return globalTypeConfig
185
+ }
186
+ }
187
+ ```
188
+
189
+ 4. Now you can proceed to generate a model for your new connection, like so:
190
+
191
+ ```sh
192
+ yarn psy g:model MyNewModel someField:text --connection-name=myAlternateConnection
193
+ ```
194
+
195
+ Dream will automatically read the connectionName and use it to derive the `MyAlternateConnectionApplicationModel` automatically, though if this isn't correct, you will need to manually adjust it.
196
+
197
+ 5. Alternate db engine support
198
+
199
+ If you would like to use an alternate db engine, this is also now supported. To do this, you will need to provide a query driver class that extends one of our base query driver classes. As an example, I recommend you take a look at the `MysqlQueryDriver.ts` file housed within the test-app folder of this repo. This class is not ready for production use, but is a good jumping off point for those interested in supporting a different query driver for dream.
200
+
201
+ To utilize this feature, simply provide a different query driver class in your db connection config, like so:
202
+
203
+ ```ts
204
+ // conf/dream.ts
205
+
206
+ app.set('db', {
207
+ queryDriverClass: MyCustomQueryDriverClass,
208
+ ...
209
+ })
210
+ ```
211
+
212
+ ## 1.4.2
213
+
214
+ - add ability to set custom import extension, which will be used when generating new files for your application
215
+
216
+ ## 1.4.1
217
+
218
+ - cache Dream app earlier in the initialization sequence
219
+
220
+ ## 1.4.0
221
+
222
+ - fix `preloadFor` infinite loop when serializers have circular references
223
+
224
+ - generated STI base serializer updated to only include the single type of the particular STI child in the OpenAPI shape for that child
225
+
226
+ - change `primaryKeyValue` from a getter to a method so it can return the correct type even when `primaryKey` has been overridden on a particular Dream model
227
+
228
+ - remove `IdType`, an unnecessary abstraction that caused type inconsistencies
229
+
230
+ - explicitly handle bigint from the database as string
231
+
232
+ ## 1.3.3
233
+
234
+ - make `referenceTypeString` public
235
+
236
+ ## 1.3.2
237
+
238
+ - restore aliasing in preload/load queries
239
+
240
+ ## 1.3.1
241
+
242
+ - throw NotNullViolation when Postgres throws a not null violation
243
+
244
+ - throw CheckViolation when Postgres throws a check violation
245
+
246
+ ## 1.3.0
247
+
248
+ - sti-child generator includes check constraint instead of not-null since the column should only be not-null for that STI child (or modified by hand to accommodate more than one STI child)
249
+
250
+ - add `Dream#hasAssociation`
251
+
252
+ - fix preloading associations on other side of a polyorphic belongs-to association so that we don't set an association on a dream model that doesn't define that association
253
+
254
+ - fix preloading association on the other side of a polymorphic belongs-to since the same association name may be defined differently on different models. For example, taskable may be a Chore or a Workout, both of which have an `images` association, but `images` goes through ChoreImage on Chore and through WorkoutImage on Workout
255
+
256
+ - fix preloadFor when a rendersOne/Many renders a polymorphic belongs-to (was only preloading serializer associations for one of the polymorphically associated models)
257
+
258
+ - fix preloadFor when an explicit serializer option is provided to a rendersOne/Many
259
+
260
+ ## 1.2.1
261
+
262
+ - Throw DataTypeColumnTypeMismatch when Postgres throws an error attempting to save to a column with a value that can't be cast to the column type.
263
+
264
+ ## 1.2.0
265
+
266
+ - Add Dream.lookup, enabling devs to tap into the IOC provided by dream to dodge circular import issues
267
+
268
+ ## 1.1.2
269
+
270
+ - CliFileWriter does not raise error if the file we are writing is not in the file system yet.
271
+
272
+ ## 1.1.1
273
+
274
+ - Add fs.writeFile options as third argument to CliFileWriter.write, enabling psychic to provide custom flags when writing openapi.json files.
275
+
276
+ ## 1.1.0
277
+
278
+ - Remove support for preloadThroughColumns. They were broken, fixing them would be overly complex, and the same effect can be obtained using flatten on a serializer rendersOne
279
+
280
+ ## 1.0.6
281
+
282
+ - Fix joining after a through a polymorphic BelongsTo
283
+ association.
284
+
285
+ - Improve join implementation
286
+
287
+ - Disable leftJoinPreload preloadThroughColumns since it doesn't actually work on through associations that resolve to a source that doesn't match the association name (and we were unnecessarily including columns in the leftJoinPreload statement even when there was no `preloadThroughColumns`, thereby bloating the queries unnecessarily)
288
+
289
+ ## 1.0.5
290
+
291
+ - Support HasOne/Many through polymorphic BelongsTo (trick is that it uses the associated model from the HasOne/Many to limit the BelongsTo to a single associated class / table)
292
+
293
+ - Fix HasOne/Many through source type
294
+
295
+ - sync process is now fail-safe, leveraging a utility which caches old copies of files before writing to them. If an exception is thrown at any point during the process, dream will revert all files written using the new `CliFileWriter` class
296
+
297
+ ## 1.0.4
298
+
299
+ - properly exclude type from `DreamParamSafeColumnNames`
300
+
301
+ ## 1.0.3
302
+
303
+ - exclude type from `DreamParamSafeColumnNames`
304
+
305
+ ## 1.0.2
306
+
307
+ - stop computing foreign keys in schema builder when building schema for through associations
308
+
309
+ ## 1.0.1
310
+
311
+ - [bug] fix preloading STI model via polymporhic association (polymorphic type was being altered to the STI child rather than left as the STI base)
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>DreamMigrationHelpers | @rvoh/dream</title><meta name="description" content="Documentation for @rvoh/dream"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@rvoh/dream</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@rvoh/dream</a></li><li><a href="../modules/db.html">db</a></li><li><a href="db.DreamMigrationHelpers.html">DreamMigrationHelpers</a></li></ul><h1>Class DreamMigrationHelpers</h1></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/850a5c08b58f8fee6018d3f790c3c66262a6c2bb/src/db/migration-helpers/DreamMigrationHelpers.ts#L3">src/db/migration-helpers/DreamMigrationHelpers.ts:3</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="db.DreamMigrationHelpers.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>DreamMigrationHelpers | @rvoh/dream</title><meta name="description" content="Documentation for @rvoh/dream"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">@rvoh/dream</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">@rvoh/dream</a></li><li><a href="../modules/db.html">db</a></li><li><a href="db.DreamMigrationHelpers.html">DreamMigrationHelpers</a></li></ul><h1>Class DreamMigrationHelpers</h1></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/0a16a25c1497680008c6b226670e1904549b5fd0/src/db/migration-helpers/DreamMigrationHelpers.ts#L3">src/db/migration-helpers/DreamMigrationHelpers.ts:3</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="db.DreamMigrationHelpers.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
2
2
  </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="db.DreamMigrationHelpers.html#addDeferrableUniqueConstraint" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Deferrable<wbr/>Unique<wbr/>Constraint</span></a>
3
3
  <a href="db.DreamMigrationHelpers.html#addEnumValue" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Enum<wbr/>Value</span></a>
4
4
  <a href="db.DreamMigrationHelpers.html#createExtension" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Extension</span></a>
@@ -16,11 +16,11 @@ indexes.</p>
16
16
  </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-symbol">{ </span><br/><span>    </span><span class="tsd-kind-property">columns</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></span><div class="tsd-comment tsd-typography"><p>Configuration options</p>
17
17
  </div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">columns</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h5><div class="tsd-comment tsd-typography"><p>The names of the columns to include in the constraint</p>
18
18
  </div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>The name of the table</p>
19
- </div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/850a5c08b58f8fee6018d3f790c3c66262a6c2bb/src/db/migration-helpers/DreamMigrationHelpers.ts#L41">src/db/migration-helpers/DreamMigrationHelpers.ts:41</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="addEnumValue" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>add<wbr/>Enum<wbr/>Value</span><a href="#addEnumValue" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="addEnumValue.addEnumValue-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add<wbr/>Enum<wbr/>Value</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span>, <span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#addEnumValue.addEnumValue-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Add a value to an enum.</p>
19
+ </div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/0a16a25c1497680008c6b226670e1904549b5fd0/src/db/migration-helpers/DreamMigrationHelpers.ts#L41">src/db/migration-helpers/DreamMigrationHelpers.ts:41</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="addEnumValue" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>add<wbr/>Enum<wbr/>Value</span><a href="#addEnumValue" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="addEnumValue.addEnumValue-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add<wbr/>Enum<wbr/>Value</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span>, <span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#addEnumValue.addEnumValue-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Add a value to an enum.</p>
20
20
  <p>Note that this always includes &quot;IF NOT EXISTS&quot;, so is safe to re-run multiple times.</p>
21
21
  </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">db</span>: <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The Kysely database object passed into the migration up/down function</p>
22
22
  </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">__namedParameters</span>: <span class="tsd-signature-type">AddValueToEnumOpts</span></span><div class="tsd-comment tsd-typography"><p>The options for adding the enum value</p>
23
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/850a5c08b58f8fee6018d3f790c3c66262a6c2bb/src/db/migration-helpers/DreamMigrationHelpers.ts#L71">src/db/migration-helpers/DreamMigrationHelpers.ts:71</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="createExtension" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>create<wbr/>Extension</span><a href="#createExtension" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="createExtension.createExtension-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">create<wbr/>Extension</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span>, <span class="tsd-kind-parameter">extensionName</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#createExtension.createExtension-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Create a database extension.</p>
23
+ </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/0a16a25c1497680008c6b226670e1904549b5fd0/src/db/migration-helpers/DreamMigrationHelpers.ts#L71">src/db/migration-helpers/DreamMigrationHelpers.ts:71</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="createExtension" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>create<wbr/>Extension</span><a href="#createExtension" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="createExtension.createExtension-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">create<wbr/>Extension</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span>, <span class="tsd-kind-parameter">extensionName</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#createExtension.createExtension-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Create a database extension.</p>
24
24
  <pre><code><span class="hl-1"> </span><span class="hl-7">// Add the case insensitive extension</span><br/><span class="hl-1"> </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">DreamMigrationHelpers</span><span class="hl-1">.</span><span class="hl-5">createExtension</span><span class="hl-1">(</span><span class="hl-4">db</span><span class="hl-1">, </span><span class="hl-6">&#39;citext&#39;</span><span class="hl-1">)</span><br/><br/><span class="hl-1"> </span><span class="hl-7">// Add the pg trigram extension</span><br/><span class="hl-1"> </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">DreamMigrationHelpers</span><span class="hl-1">.</span><span class="hl-5">createExtension</span><span class="hl-1">(</span><span class="hl-4">db</span><span class="hl-1">, </span><span class="hl-6">&#39;pg_trgm&#39;</span><span class="hl-1">)</span>
25
25
  </code><button>Copy</button></pre>
26
26
 
@@ -29,23 +29,23 @@ indexes.</p>
29
29
  </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-symbol">{ </span><br/><span>    </span><span class="tsd-kind-property">ifNotExists</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><span class="tsd-kind-property">publicSchema</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol"> = {}</span></span><div class="tsd-comment tsd-typography"><p>Configuration options</p>
30
30
  </div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">if<wbr/>Not<wbr/>Exists</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>Only add the extension if it doesn't already exist</p>
31
31
  </div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><code class="tsd-tag">Optional</code><span class="tsd-kind-property">public<wbr/>Schema</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span></h5><div class="tsd-comment tsd-typography"><p>Create using the public schema</p>
32
- </div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/850a5c08b58f8fee6018d3f790c3c66262a6c2bb/src/db/migration-helpers/DreamMigrationHelpers.ts#L93">src/db/migration-helpers/DreamMigrationHelpers.ts:93</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="createGinIndex" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>create<wbr/>Gin<wbr/>Index</span><a href="#createGinIndex" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="createGinIndex.createGinIndex-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">create<wbr/>Gin<wbr/>Index</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span>, <span class="tsd-kind-parameter">indexName</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#createGinIndex.createGinIndex-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Create a gin index</p>
32
+ </div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/0a16a25c1497680008c6b226670e1904549b5fd0/src/db/migration-helpers/DreamMigrationHelpers.ts#L93">src/db/migration-helpers/DreamMigrationHelpers.ts:93</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="createGinIndex" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>create<wbr/>Gin<wbr/>Index</span><a href="#createGinIndex" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="createGinIndex.createGinIndex-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">create<wbr/>Gin<wbr/>Index</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span>, <span class="tsd-kind-parameter">indexName</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#createGinIndex.createGinIndex-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Create a gin index</p>
33
33
  </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">db</span>: <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The Kysely database object passed into the migration up/down function</p>
34
34
  </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">indexName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The name of the constraint to create</p>
35
35
  </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-symbol">{ </span><br/><span>    </span><span class="tsd-kind-property">column</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span>    </span><span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></span><div class="tsd-comment tsd-typography"><p>Configuration options</p>
36
36
  </div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">column</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>The name of the column to index</p>
37
37
  </div><div class="tsd-comment tsd-typography"></div></li><li class="tsd-parameter"><h5><span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>The name of the table</p>
38
- </div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/850a5c08b58f8fee6018d3f790c3c66262a6c2bb/src/db/migration-helpers/DreamMigrationHelpers.ts#L115">src/db/migration-helpers/DreamMigrationHelpers.ts:115</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="dropConstraint" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>drop<wbr/>Constraint</span><a href="#dropConstraint" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="dropConstraint.dropConstraint-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">drop<wbr/>Constraint</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span>, <span class="tsd-kind-parameter">constraintName</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#dropConstraint.dropConstraint-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Drop a constraint</p>
38
+ </div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/0a16a25c1497680008c6b226670e1904549b5fd0/src/db/migration-helpers/DreamMigrationHelpers.ts#L115">src/db/migration-helpers/DreamMigrationHelpers.ts:115</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="dropConstraint" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>drop<wbr/>Constraint</span><a href="#dropConstraint" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="dropConstraint.dropConstraint-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">drop<wbr/>Constraint</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span>, <span class="tsd-kind-parameter">constraintName</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#dropConstraint.dropConstraint-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Drop a constraint</p>
39
39
  <p>Note that this always includes &quot;IF NOT EXISTS&quot;, so is safe to re-run multiple times.</p>
40
40
  </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">db</span>: <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The Kysely database object passed into the migration up/down function</p>
41
41
  </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">constraintName</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The name of the constraint to create</p>
42
42
  </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-symbol">{ </span><br/><span>    </span><span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></span><div class="tsd-comment tsd-typography"><p>Configuration options</p>
43
43
  </div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter"><h5><span class="tsd-kind-property">table</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><p>The name of the table</p>
44
- </div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/850a5c08b58f8fee6018d3f790c3c66262a6c2bb/src/db/migration-helpers/DreamMigrationHelpers.ts#L138">src/db/migration-helpers/DreamMigrationHelpers.ts:138</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="dropEnumValue" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>drop<wbr/>Enum<wbr/>Value</span><a href="#dropEnumValue" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="dropEnumValue.dropEnumValue-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">drop<wbr/>Enum<wbr/>Value</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span>, <span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#dropEnumValue.dropEnumValue-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Drop a value from an enum and replace it with a different enum already
44
+ </div><div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/0a16a25c1497680008c6b226670e1904549b5fd0/src/db/migration-helpers/DreamMigrationHelpers.ts#L138">src/db/migration-helpers/DreamMigrationHelpers.ts:138</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="dropEnumValue" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>drop<wbr/>Enum<wbr/>Value</span><a href="#dropEnumValue" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="dropEnumValue.dropEnumValue-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">drop<wbr/>Enum<wbr/>Value</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span>, <span class="tsd-kind-parameter">__namedParameters</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#dropEnumValue.dropEnumValue-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Drop a value from an enum and replace it with a different enum already
45
45
  present in the enum type (or optionally remove it from array columns).</p>
46
46
  </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">db</span>: <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The Kysely database object passed into the migration up/down function</p>
47
47
  </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">__namedParameters</span>: <span class="tsd-signature-type">DropValueFromEnumOpts</span></span><div class="tsd-comment tsd-typography"><p>The options for dropping the enum value</p>
48
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/850a5c08b58f8fee6018d3f790c3c66262a6c2bb/src/db/migration-helpers/DreamMigrationHelpers.ts#L191">src/db/migration-helpers/DreamMigrationHelpers.ts:191</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="newTransaction" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>new<wbr/>Transaction</span><a href="#newTransaction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="newTransaction.newTransaction-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">new<wbr/>Transaction</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#newTransaction.newTransaction-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Forces a new transaction boundary in migration execution.</p>
48
+ </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/0a16a25c1497680008c6b226670e1904549b5fd0/src/db/migration-helpers/DreamMigrationHelpers.ts#L191">src/db/migration-helpers/DreamMigrationHelpers.ts:191</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="newTransaction" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>new<wbr/>Transaction</span><a href="#newTransaction" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="newTransaction.newTransaction-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">new<wbr/>Transaction</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#newTransaction.newTransaction-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Forces a new transaction boundary in migration execution.</p>
49
49
  <p>When called in a migration file, this method ensures that any existing transaction
50
50
  is committed before this migration runs, and a new transaction is started before the
51
51
  migration in this file. This is essential for migrations that depend on previously
@@ -56,7 +56,7 @@ enum values to be committed to the database first.</p>
56
56
  <pre><code class="ts"><span class="hl-7">// first migration file: Add enum value</span><br/><span class="hl-3">export</span><span class="hl-1"> </span><span class="hl-0">async</span><span class="hl-1"> </span><span class="hl-0">function</span><span class="hl-1"> </span><span class="hl-5">up</span><span class="hl-1">(</span><span class="hl-4">db</span><span class="hl-1">: </span><span class="hl-9">Kysely</span><span class="hl-1">&lt;</span><span class="hl-9">any</span><span class="hl-1">&gt;): </span><span class="hl-9">Promise</span><span class="hl-1">&lt;</span><span class="hl-9">void</span><span class="hl-1">&gt; {</span><br/><span class="hl-1"> </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">DreamMigrationHelpers</span><span class="hl-1">.</span><span class="hl-5">addEnumValue</span><span class="hl-1">(</span><span class="hl-4">db</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-4">enumName:</span><span class="hl-1"> </span><span class="hl-6">&#39;user_status&#39;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-4">value:</span><span class="hl-1"> </span><span class="hl-6">&#39;premium&#39;</span><br/><span class="hl-1"> })</span><br/><span class="hl-1">}</span><br/><br/><span class="hl-7">// second migration file: Add check constraint that depends on the enum value</span><br/><span class="hl-3">export</span><span class="hl-1"> </span><span class="hl-0">async</span><span class="hl-1"> </span><span class="hl-0">function</span><span class="hl-1"> </span><span class="hl-5">up</span><span class="hl-1">(</span><span class="hl-4">db</span><span class="hl-1">: </span><span class="hl-9">Kysely</span><span class="hl-1">&lt;</span><span class="hl-9">any</span><span class="hl-1">&gt;): </span><span class="hl-9">Promise</span><span class="hl-1">&lt;</span><span class="hl-9">void</span><span class="hl-1">&gt; {</span><br/><span class="hl-1"> </span><span class="hl-4">DreamMigrationHelpers</span><span class="hl-1">.</span><span class="hl-5">newTransaction</span><span class="hl-1">() </span><span class="hl-7">// Ensure enum value is committed first</span><br/><br/><span class="hl-1"> </span><span class="hl-3">await</span><span class="hl-1"> </span><span class="hl-4">db</span><span class="hl-1">.</span><span class="hl-4">schema</span><br/><span class="hl-1"> .</span><span class="hl-5">alterTable</span><span class="hl-1">(</span><span class="hl-6">&#39;users&#39;</span><span class="hl-1">)</span><br/><span class="hl-1"> .</span><span class="hl-5">addCheckConstraint</span><span class="hl-1">(</span><br/><span class="hl-1"> </span><span class="hl-6">&#39;check_premium_users&#39;</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">sql</span><span class="hl-6">`status = &#39;premium&#39; OR credits &lt; 100`</span><br/><span class="hl-1"> )</span><br/><span class="hl-1"> .</span><span class="hl-5">execute</span><span class="hl-1">()</span><br/><span class="hl-1">}</span>
57
57
  </code><button type="button">Copy</button></pre>
58
58
 
59
- </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/850a5c08b58f8fee6018d3f790c3c66262a6c2bb/src/db/migration-helpers/DreamMigrationHelpers.ts#L179">src/db/migration-helpers/DreamMigrationHelpers.ts:179</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="renameTable" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>rename<wbr/>Table</span><a href="#renameTable" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="renameTable.renameTable-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">rename<wbr/>Table</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span>, <span class="tsd-kind-parameter">from</span>, <span class="tsd-kind-parameter">to</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#renameTable.renameTable-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Rename a table and its associated primary key sequence.</p>
59
+ </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/0a16a25c1497680008c6b226670e1904549b5fd0/src/db/migration-helpers/DreamMigrationHelpers.ts#L179">src/db/migration-helpers/DreamMigrationHelpers.ts:179</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="renameTable" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Static</code><span>rename<wbr/>Table</span><a href="#renameTable" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="renameTable.renameTable-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">rename<wbr/>Table</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">db</span>, <span class="tsd-kind-parameter">from</span>, <span class="tsd-kind-parameter">to</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span><a href="#renameTable.renameTable-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Rename a table and its associated primary key sequence.</p>
60
60
  <p>This method renames both the table and its primary key sequence to keep them
61
61
  in sync. When PostgreSQL creates a table with a serial or bigserial primary key,
62
62
  it automatically creates a sequence named <code>{tablename}_id_seq</code>. If you only rename
@@ -66,4 +66,4 @@ key column named 'id'.</p>
66
66
  </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">db</span>: <span class="tsd-signature-type">Kysely</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The Kysely database object passed into the migration up/down function</p>
67
67
  </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">from</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The current name of the table to rename</p>
68
68
  </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">to</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The new name for the table</p>
69
- </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/850a5c08b58f8fee6018d3f790c3c66262a6c2bb/src/db/migration-helpers/DreamMigrationHelpers.ts#L19">src/db/migration-helpers/DreamMigrationHelpers.ts:19</a></li></ul></aside></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#addDeferrableUniqueConstraint" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Deferrable<wbr/>Unique<wbr/>Constraint</span></a><a href="#addEnumValue" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Enum<wbr/>Value</span></a><a href="#createExtension" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Extension</span></a><a href="#createGinIndex" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Gin<wbr/>Index</span></a><a href="#dropConstraint" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>drop<wbr/>Constraint</span></a><a href="#dropEnumValue" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>drop<wbr/>Enum<wbr/>Value</span></a><a href="#newTransaction" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>new<wbr/>Transaction</span></a><a href="#renameTable" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>rename<wbr/>Table</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@rvoh/dream</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
69
+ </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/rvohealth/dream/blob/0a16a25c1497680008c6b226670e1904549b5fd0/src/db/migration-helpers/DreamMigrationHelpers.ts#L19">src/db/migration-helpers/DreamMigrationHelpers.ts:19</a></li></ul></aside></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Constructors"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Constructors</summary><div><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#addDeferrableUniqueConstraint" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Deferrable<wbr/>Unique<wbr/>Constraint</span></a><a href="#addEnumValue" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Enum<wbr/>Value</span></a><a href="#createExtension" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Extension</span></a><a href="#createGinIndex" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>create<wbr/>Gin<wbr/>Index</span></a><a href="#dropConstraint" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>drop<wbr/>Constraint</span></a><a href="#dropEnumValue" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>drop<wbr/>Enum<wbr/>Value</span></a><a href="#newTransaction" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>new<wbr/>Transaction</span></a><a href="#renameTable" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>rename<wbr/>Table</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>@rvoh/dream</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>