Describe the bug
Hi
I'm Trying to change type and server default value of a column, but it complains about it have a dependent object with an error, the idea is to have the same mssql_drop_* parameters in alter table also
Expected behavior
To be able to drop the constraints asociated with the column
To Reproduce
op.alter_column('access', 'created_at',
existing_type=sa.DATETIME(),
type_=sqlalchemy_utc.sqltypes.UtcDateTime(timezone=True),
server_default=sqlalchemy_utc.utcnow(), # type: ignore
existing_nullable=False,
existing_server_default=sa.text('(getutcdate())'))
Error
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (pyodbc.ProgrammingError) ('42000', "[42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]The object 'DF__access__created___2B0A656D' is dependent on column 'created_at'. (5074) (SQLExecDirectW)")
[SQL: ALTER TABLE access ALTER COLUMN created_at DATETIMEOFFSET NOT NULL]
(Background on this error at: https://sqlalche.me/e/20/f405)
Versions.
- OS: Linux KDE Neon / Ubuntu Noble 2024.4
- Python: Python 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0] on linux
- Alembic: alembic 1.17.0
- SQLAlchemy: 2.0.37
- Database: Microsoft SQL Server 2025 preview
- DBAPI: mssql (UnixODBC)
Have a awesome day! thanks for your amazing job with alembic
Describe the bug
Hi
I'm Trying to change type and server default value of a column, but it complains about it have a dependent object with an error, the idea is to have the same
mssql_drop_*parameters in alter table alsoExpected behavior
To be able to drop the constraints asociated with the column
To Reproduce
Error
Versions.
Have a awesome day! thanks for your amazing job with alembic