(11:29:22 AM) mriedem: i sort of remember this discussion with jaypipes on https://review.opendev.org/#/c/557958/
(11:29:26 AM) mriedem: which uses server_default
(11:30:09 AM) dansmith: I guess server_default would be one option, but it involves another schema change which I think is less good since we have to backport this
(11:34:30 AM) mriedem: https://docs.sqlalchemy.org/en/13/core/metadata.html#sqlalchemy.schema.Column.params.default
(11:34:41 AM) mriedem: "which will be invoked upon insert if this column is otherwise not specified in the VALUES clause of the insert"
(11:34:45 AM) mriedem: didn't realize it would backfill though
(11:35:03 AM) dansmith: right, I always assume it fills on read too, but just insert
(11:35:07 AM) mriedem: https://docs.sqlalchemy.org/en/13/core/metadata.html#sqlalchemy.schema.Column.params.server_default - "A FetchedValue instance, str, Unicode or text() construct representing the DDL DEFAULT value for the column."
(11:35:23 AM) mriedem: so yeah, i guess never use default in migrations
Some more context:
(11:29:22 AM) mriedem: i sort of remember this discussion with jaypipes on https:/ /review. opendev. org/#/c/ 557958/ /docs.sqlalchem y.org/en/ 13/core/ metadata. html#sqlalchemy .schema. Column. params. default /docs.sqlalchem y.org/en/ 13/core/ metadata. html#sqlalchemy .schema. Column. params. server_ default - "A FetchedValue instance, str, Unicode or text() construct representing the DDL DEFAULT value for the column."
(11:29:26 AM) mriedem: which uses server_default
(11:30:09 AM) dansmith: I guess server_default would be one option, but it involves another schema change which I think is less good since we have to backport this
(11:34:30 AM) mriedem: https:/
(11:34:41 AM) mriedem: "which will be invoked upon insert if this column is otherwise not specified in the VALUES clause of the insert"
(11:34:45 AM) mriedem: didn't realize it would backfill though
(11:35:03 AM) dansmith: right, I always assume it fills on read too, but just insert
(11:35:07 AM) mriedem: https:/
(11:35:23 AM) mriedem: so yeah, i guess never use default in migrations