Describe the use case
Add support for IF [NOT] EXISTS for ADDDROP COLUMN operations available on PostgreSQL
Databases / Backends / Drivers targeted
PostgreSQL
Example Use
The goal is to have automatically generated operations rewritable to add if_exists/if_not_exists attributes, then rendered with postgres compiler.
@writer.rewrites(ops.AddColumnOp)
def add_column(autogen_context, _revision, op: ops.AddColumnOp):
op.if_not_exists = True
would generate following SQL
ALTER TABLE t ADD COLUMN IF NOT EXISTS c INTEGER;
Additional context
Spin-off of #524 for ADD/DROP COLUMN
Have a nice day!
Describe the use case
Add support for
IF [NOT] EXISTSforADDDROP COLUMNoperations available on PostgreSQLDatabases / Backends / Drivers targeted
PostgreSQL
Example Use
The goal is to have automatically generated operations rewritable to add
if_exists/if_not_existsattributes, then rendered with postgres compiler.would generate following SQL
Additional context
Spin-off of #524 for
ADD/DROP COLUMNHave a nice day!