diff options
Diffstat (limited to 'alembic')
-rw-r--r-- | alembic/op.pyi | 11 | ||||
-rw-r--r-- | alembic/operations/ops.py | 11 |
2 files changed, 10 insertions, 12 deletions
diff --git a/alembic/op.pyi b/alembic/op.pyi index 229fff3..01edb61 100644 --- a/alembic/op.pyi +++ b/alembic/op.pyi @@ -667,9 +667,7 @@ def create_primary_key( 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 @@ -729,9 +727,10 @@ def create_table( 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 diff --git a/alembic/operations/ops.py b/alembic/operations/ops.py index aab45d4..f95ab70 100644 --- a/alembic/operations/ops.py +++ b/alembic/operations/ops.py @@ -308,9 +308,7 @@ class CreatePrimaryKeyOp(AddConstraintOp): 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 @@ -1214,9 +1212,10 @@ class CreateTableOp(MigrateOperation): 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 |