1
|
|
|
"""Initial Migration |
2
|
|
|
|
3
|
|
|
Revision ID: 7b4195cb191c |
4
|
|
|
Revises: |
5
|
|
|
Create Date: 2023-05-22 23:22:29.697375 |
6
|
|
|
|
7
|
|
|
""" |
8
|
|
|
from alembic import op |
9
|
|
|
import sqlalchemy as sa |
10
|
|
|
|
11
|
|
|
|
12
|
|
|
# revision identifiers, used by Alembic. |
13
|
|
|
revision = '7b4195cb191c' |
14
|
|
|
down_revision = None |
15
|
|
|
branch_labels = None |
16
|
|
|
depends_on = None |
17
|
|
|
|
18
|
|
|
|
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
|
|
|
) |
92
|
|
|
# ### end Alembic commands ### |
93
|
|
|
|
94
|
|
|
|
95
|
|
|
def downgrade(): |
96
|
|
|
# ### commands auto generated by Alembic - please adjust! ### |
97
|
|
|
op.drop_table('user') |
98
|
|
|
op.drop_table('transactions') |
99
|
|
|
op.drop_table('total') |
100
|
|
|
op.drop_table('hold') |
101
|
|
|
op.drop_table('settings') |
102
|
|
|
op.drop_table('schedule') |
103
|
|
|
op.drop_table('running') |
104
|
|
|
op.drop_table('email') |
105
|
|
|
op.drop_table('balance') |
106
|
|
|
# ### end Alembic commands ### |
107
|
|
|
|