Conditions | 1 |
Total Lines | 72 |
Code Lines | 63 |
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.Column('subjectstr', sa.String(length=100), nullable=True), |
||
33 | sa.Column('startstr', sa.String(length=100), nullable=True), |
||
34 | sa.Column('endstr', sa.String(length=100), nullable=True), |
||
35 | sa.PrimaryKeyConstraint('id') |
||
36 | ) |
||
37 | op.create_table('running', |
||
38 | sa.Column('id', sa.Integer(), nullable=False), |
||
39 | sa.Column('amount', sa.Numeric(precision=10, scale=2), nullable=True), |
||
40 | sa.Column('date', sa.Date(), nullable=True), |
||
41 | sa.PrimaryKeyConstraint('id') |
||
42 | ) |
||
43 | op.create_table('schedule', |
||
44 | sa.Column('id', sa.Integer(), nullable=False), |
||
45 | sa.Column('name', sa.String(length=100), nullable=True), |
||
46 | sa.Column('amount', sa.Numeric(precision=10, scale=2), nullable=True), |
||
47 | sa.Column('frequency', sa.String(length=100), nullable=True), |
||
48 | sa.Column('startdate', sa.Date(), nullable=True), |
||
49 | sa.Column('type', sa.String(length=100), nullable=True), |
||
50 | sa.PrimaryKeyConstraint('id'), |
||
51 | sa.UniqueConstraint('name') |
||
52 | ) |
||
53 | op.create_table('settings', |
||
54 | sa.Column('id', sa.Integer(), nullable=False), |
||
55 | sa.Column('name', sa.String(length=100), nullable=True), |
||
56 | sa.Column('value', sa.Boolean(), nullable=True), |
||
57 | sa.PrimaryKeyConstraint('id'), |
||
58 | sa.UniqueConstraint('name') |
||
59 | ) |
||
60 | op.create_table('total', |
||
61 | sa.Column('id', sa.Integer(), nullable=False), |
||
62 | sa.Column('amount', sa.Numeric(precision=10, scale=2), nullable=True), |
||
63 | sa.Column('date', sa.Date(), nullable=True), |
||
64 | sa.Column('name', sa.String(length=100), nullable=True), |
||
65 | sa.Column('type', sa.String(length=100), nullable=True), |
||
66 | sa.PrimaryKeyConstraint('id') |
||
67 | ) |
||
68 | op.create_table('hold', |
||
69 | sa.Column('id', sa.Integer(), nullable=False), |
||
70 | sa.Column('amount', sa.Numeric(precision=10, scale=2), nullable=True), |
||
71 | sa.Column('name', sa.String(length=100), nullable=True), |
||
72 | sa.Column('type', sa.String(length=100), nullable=True), |
||
73 | sa.PrimaryKeyConstraint('id') |
||
74 | ) |
||
75 | op.create_table('transactions', |
||
76 | sa.Column('id', sa.Integer(), nullable=False), |
||
77 | sa.Column('name', sa.String(length=100), nullable=True), |
||
78 | sa.Column('date', sa.Date(), nullable=True), |
||
79 | sa.Column('amount', sa.Numeric(precision=10, scale=2), nullable=True), |
||
80 | sa.Column('type', sa.String(length=100), nullable=True), |
||
81 | sa.PrimaryKeyConstraint('id') |
||
82 | ) |
||
83 | op.create_table('user', |
||
84 | sa.Column('id', sa.Integer(), nullable=False), |
||
85 | sa.Column('email', sa.String(length=100), nullable=True), |
||
86 | sa.Column('password', sa.String(length=100), nullable=True), |
||
87 | sa.Column('name', sa.String(length=1000), nullable=True), |
||
88 | sa.Column('admin', sa.Boolean(), nullable=True), |
||
89 | sa.PrimaryKeyConstraint('id'), |
||
90 | sa.UniqueConstraint('email') |
||
91 | ) |
||
107 |