Skip to content

Commit ebffea0

Browse files
committed
Format alembic code with Black
1 parent b8f64f6 commit ebffea0

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed

{{cookiecutter.project_slug}}/backend/app/alembic/env.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,9 @@ def run_migrations_online():
6767
6868
"""
6969
configuration = config.get_section(config.config_ini_section)
70-
configuration['sqlalchemy.url'] = get_url()
70+
configuration["sqlalchemy.url"] = get_url()
7171
connectable = engine_from_config(
72-
configuration,
73-
prefix="sqlalchemy.",
74-
poolclass=pool.NullPool,
72+
configuration, prefix="sqlalchemy.", poolclass=pool.NullPool,
7573
)
7674

7775
with connectable.connect() as connection:
Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""First revision
22
33
Revision ID: d4867f3a4c0a
4-
Revises:
4+
Revises:
55
Create Date: 2019-04-17 13:53:32.978401
66
77
"""
@@ -10,48 +10,50 @@
1010

1111

1212
# revision identifiers, used by Alembic.
13-
revision = 'd4867f3a4c0a'
13+
revision = "d4867f3a4c0a"
1414
down_revision = None
1515
branch_labels = None
1616
depends_on = None
1717

1818

1919
def upgrade():
2020
# ### commands auto generated by Alembic - please adjust! ###
21-
op.create_table('user',
22-
sa.Column('id', sa.Integer(), nullable=False),
23-
sa.Column('full_name', sa.String(), nullable=True),
24-
sa.Column('email', sa.String(), nullable=True),
25-
sa.Column('hashed_password', sa.String(), nullable=True),
26-
sa.Column('is_active', sa.Boolean(), nullable=True),
27-
sa.Column('is_superuser', sa.Boolean(), nullable=True),
28-
sa.PrimaryKeyConstraint('id')
21+
op.create_table(
22+
"user",
23+
sa.Column("id", sa.Integer(), nullable=False),
24+
sa.Column("full_name", sa.String(), nullable=True),
25+
sa.Column("email", sa.String(), nullable=True),
26+
sa.Column("hashed_password", sa.String(), nullable=True),
27+
sa.Column("is_active", sa.Boolean(), nullable=True),
28+
sa.Column("is_superuser", sa.Boolean(), nullable=True),
29+
sa.PrimaryKeyConstraint("id"),
2930
)
30-
op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True)
31-
op.create_index(op.f('ix_user_full_name'), 'user', ['full_name'], unique=False)
32-
op.create_index(op.f('ix_user_id'), 'user', ['id'], unique=False)
33-
op.create_table('item',
34-
sa.Column('id', sa.Integer(), nullable=False),
35-
sa.Column('title', sa.String(), nullable=True),
36-
sa.Column('description', sa.String(), nullable=True),
37-
sa.Column('owner_id', sa.Integer(), nullable=True),
38-
sa.ForeignKeyConstraint(['owner_id'], ['user.id'], ),
39-
sa.PrimaryKeyConstraint('id')
31+
op.create_index(op.f("ix_user_email"), "user", ["email"], unique=True)
32+
op.create_index(op.f("ix_user_full_name"), "user", ["full_name"], unique=False)
33+
op.create_index(op.f("ix_user_id"), "user", ["id"], unique=False)
34+
op.create_table(
35+
"item",
36+
sa.Column("id", sa.Integer(), nullable=False),
37+
sa.Column("title", sa.String(), nullable=True),
38+
sa.Column("description", sa.String(), nullable=True),
39+
sa.Column("owner_id", sa.Integer(), nullable=True),
40+
sa.ForeignKeyConstraint(["owner_id"], ["user.id"],),
41+
sa.PrimaryKeyConstraint("id"),
4042
)
41-
op.create_index(op.f('ix_item_description'), 'item', ['description'], unique=False)
42-
op.create_index(op.f('ix_item_id'), 'item', ['id'], unique=False)
43-
op.create_index(op.f('ix_item_title'), 'item', ['title'], unique=False)
43+
op.create_index(op.f("ix_item_description"), "item", ["description"], unique=False)
44+
op.create_index(op.f("ix_item_id"), "item", ["id"], unique=False)
45+
op.create_index(op.f("ix_item_title"), "item", ["title"], unique=False)
4446
# ### end Alembic commands ###
4547

4648

4749
def downgrade():
4850
# ### commands auto generated by Alembic - please adjust! ###
49-
op.drop_index(op.f('ix_item_title'), table_name='item')
50-
op.drop_index(op.f('ix_item_id'), table_name='item')
51-
op.drop_index(op.f('ix_item_description'), table_name='item')
52-
op.drop_table('item')
53-
op.drop_index(op.f('ix_user_id'), table_name='user')
54-
op.drop_index(op.f('ix_user_full_name'), table_name='user')
55-
op.drop_index(op.f('ix_user_email'), table_name='user')
56-
op.drop_table('user')
51+
op.drop_index(op.f("ix_item_title"), table_name="item")
52+
op.drop_index(op.f("ix_item_id"), table_name="item")
53+
op.drop_index(op.f("ix_item_description"), table_name="item")
54+
op.drop_table("item")
55+
op.drop_index(op.f("ix_user_id"), table_name="user")
56+
op.drop_index(op.f("ix_user_full_name"), table_name="user")
57+
op.drop_index(op.f("ix_user_email"), table_name="user")
58+
op.drop_table("user")
5759
# ### end Alembic commands ###

0 commit comments

Comments
 (0)