diff --git a/alembic/op.pyi b/alembic/op.pyi index 83deac1e..92044469 100644 --- a/alembic/op.pyi +++ b/alembic/op.pyi @@ -747,7 +747,12 @@ def create_primary_key( """ -def create_table(table_name: str, *columns: SchemaItem, **kw: Any) -> Table: +def create_table( + table_name: str, + *columns: SchemaItem, + if_not_exists: Optional[bool] = None, + **kw: Any, +) -> Table: r"""Issue a "create table" instruction using the current migration context. @@ -818,6 +823,10 @@ def create_table(table_name: str, *columns: SchemaItem, **kw: Any) -> Table: quoting of the schema outside of the default behavior, use the SQLAlchemy construct :class:`~sqlalchemy.sql.elements.quoted_name`. + :param if_not_exists: If True, adds IF NOT EXISTS operator when + creating the new table. + + .. versionadded:: 1.13.3 :param \**kw: Other keyword arguments are passed to the underlying :class:`sqlalchemy.schema.Table` object created for the command. @@ -998,7 +1007,11 @@ def drop_index( """ def drop_table( - table_name: str, *, schema: Optional[str] = None, **kw: Any + table_name: str, + *, + schema: Optional[str] = None, + if_exists: Optional[bool] = None, + **kw: Any, ) -> None: r"""Issue a "drop table" instruction using the current migration context. @@ -1013,6 +1026,10 @@ def drop_table( quoting of the schema outside of the default behavior, use the SQLAlchemy construct :class:`~sqlalchemy.sql.elements.quoted_name`. + :param if_exists: If True, adds IF EXISTS operator when + dropping the table. + + .. versionadded:: 1.13.3 :param \**kw: Other keyword arguments are passed to the underlying :class:`sqlalchemy.schema.Table` object created for the command.