@metaobjectsdev/migrate-ts 1.0.0 → 1.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.
package/src/types.ts CHANGED
@@ -233,7 +233,15 @@ export type Change =
233
233
  | { kind: "drop-column"; table: string; schema?: string; column: string; restore?: ColumnDescriptor; status: ChangeStatus }
234
234
  | { kind: "rename-column"; table: string; schema?: string; from: string; to: string; status: ChangeStatus }
235
235
  | { kind: "change-column-type"; table: string; schema?: string; column: string;
236
- from: SqlType; to: SqlType; status: ChangeStatus }
236
+ from: SqlType; to: SqlType;
237
+ /** The column's live default and the default it should end with, when either exists.
238
+ * Postgres converts a default with an ASSIGNMENT cast, never through USING, so a type
239
+ * change that needs USING must drop the default first and set it after, which the
240
+ * emitter can only do knowing both. A type change CARRIES its column's default change
241
+ * rather than sitting beside a separate `change-column-default`, whose down would run
242
+ * first and set the old default on a column still holding the new type. */
243
+ fromDefault?: ColumnDefault; toDefault?: ColumnDefault;
244
+ status: ChangeStatus }
237
245
  | { kind: "change-column-nullable"; table: string; schema?: string; column: string;
238
246
  from: boolean; to: boolean; status: ChangeStatus }
239
247
  | { kind: "change-column-default"; table: string; schema?: string; column: string;