from alembic import op
- op.create_primary_key(
- "pk_my_table", "my_table", ["id", "version"]
- )
+ op.create_primary_key("pk_my_table", "my_table", ["id", "version"])
This internally generates a :class:`~sqlalchemy.schema.Table` object
containing the necessary columns, then generates a new
from sqlalchemy import Column, TIMESTAMP, func
# specify "DEFAULT NOW" along with the "timestamp" column
- op.create_table('account',
- Column('id', INTEGER, primary_key=True),
- Column('timestamp', TIMESTAMP, server_default=func.now())
+ op.create_table(
+ "account",
+ Column("id", INTEGER, primary_key=True),
+ Column("timestamp", TIMESTAMP, server_default=func.now()),
)
The function also returns a newly created
:version: 1.10.5
:include_notes_from: unreleased
- .. change::
- :tags: misc
- :tickets: 1220
-
- Update code snippets within docstrings to use ``black`` code formatting.
-
.. changelog::
:version: 1.10.4
:released: April 24, 2023