Conditions | 1 |
Total Lines | 61 |
Code Lines | 53 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | """Initial Migration |
||
19 | def upgrade(): |
||
20 | # ### commands auto generated by Alembic - please adjust! ### |
||
21 | op.create_table('balance', |
||
22 | sa.Column('id', sa.Integer(), nullable=False), |
||
23 | sa.Column('amount', sa.Numeric(precision=10, scale=2), nullable=True), |
||
24 | sa.Column('date', sa.Date(), nullable=True), |
||
25 | sa.PrimaryKeyConstraint('id') |
||
26 | ) |
||
27 | op.create_table('email', |
||
28 | sa.Column('id', sa.Integer(), nullable=False), |
||
29 | sa.Column('email', sa.String(length=100), nullable=True), |
||
30 | sa.Column('password', sa.String(length=100), nullable=True), |
||
31 | sa.Column('server', sa.String(length=100), nullable=True), |
||
32 | sa.PrimaryKeyConstraint('id') |
||
33 | ) |
||
34 | op.create_table('running', |
||
35 | sa.Column('id', sa.Integer(), nullable=False), |
||
36 | sa.Column('amount', sa.Numeric(precision=10, scale=2), nullable=True), |
||
37 | sa.Column('date', sa.Date(), nullable=True), |
||
38 | sa.PrimaryKeyConstraint('id') |
||
39 | ) |
||
40 | op.create_table('schedule', |
||
41 | sa.Column('id', sa.Integer(), nullable=False), |
||
42 | sa.Column('name', sa.String(length=100), nullable=True), |
||
43 | sa.Column('amount', sa.Numeric(precision=10, scale=2), nullable=True), |
||
44 | sa.Column('frequency', sa.String(length=100), nullable=True), |
||
45 | sa.Column('startdate', sa.Date(), nullable=True), |
||
46 | sa.Column('type', sa.String(length=100), nullable=True), |
||
47 | sa.PrimaryKeyConstraint('id'), |
||
48 | sa.UniqueConstraint('name') |
||
49 | ) |
||
50 | op.create_table('settings', |
||
51 | sa.Column('id', sa.Integer(), nullable=False), |
||
52 | sa.Column('name', sa.String(length=100), nullable=True), |
||
53 | sa.Column('value', sa.Boolean(), nullable=True), |
||
54 | sa.PrimaryKeyConstraint('id'), |
||
55 | sa.UniqueConstraint('name') |
||
56 | ) |
||
57 | op.create_table('total', |
||
58 | sa.Column('id', sa.Integer(), nullable=False), |
||
59 | sa.Column('amount', sa.Numeric(precision=10, scale=2), nullable=True), |
||
60 | sa.Column('date', sa.Date(), nullable=True), |
||
61 | sa.Column('name', sa.String(length=100), nullable=True), |
||
62 | sa.Column('type', sa.String(length=100), nullable=True), |
||
63 | sa.PrimaryKeyConstraint('id') |
||
64 | ) |
||
65 | op.create_table('transactions', |
||
66 | sa.Column('id', sa.Integer(), nullable=False), |
||
67 | sa.Column('name', sa.String(length=100), nullable=True), |
||
68 | sa.Column('date', sa.Date(), nullable=True), |
||
69 | sa.Column('amount', sa.Numeric(precision=10, scale=2), nullable=True), |
||
70 | sa.Column('type', sa.String(length=100), nullable=True), |
||
71 | sa.PrimaryKeyConstraint('id') |
||
72 | ) |
||
73 | op.create_table('user', |
||
74 | sa.Column('id', sa.Integer(), nullable=False), |
||
75 | sa.Column('email', sa.String(length=100), nullable=True), |
||
76 | sa.Column('password', sa.String(length=100), nullable=True), |
||
77 | sa.Column('name', sa.String(length=1000), nullable=True), |
||
78 | sa.PrimaryKeyConstraint('id'), |
||
79 | sa.UniqueConstraint('email') |
||
80 | ) |
||
95 |