-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy path62a551b9827c_.py
84 lines (76 loc) · 3.16 KB
/
62a551b9827c_.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
"""empty message
Revision ID: 62a551b9827c
Revises:
Create Date: 2025-03-09 17:35:35.831929
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '62a551b9827c'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('user',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=120), nullable=False),
sa.Column('email', sa.String(length=120), nullable=False),
sa.Column('password', sa.String(), nullable=False),
sa.Column('is_active', sa.Boolean(), nullable=False),
sa.Column('role', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('email')
)
op.create_table('projects',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=100), nullable=False),
sa.Column('description', sa.String(length=1500), nullable=False),
sa.Column('category', sa.String(length=100), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('goals',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('target', sa.String(length=500), nullable=False),
sa.Column('description', sa.String(length=1000), nullable=False),
sa.Column('ready', sa.Boolean(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('projects_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['projects_id'], ['projects.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('notes',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('title', sa.String(length=150), nullable=False),
sa.Column('description', sa.String(length=2000), nullable=False),
sa.Column('category', sa.String(length=100), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('projects_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['projects_id'], ['projects.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('habits',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=100), nullable=False),
sa.Column('description', sa.String(length=1000), nullable=False),
sa.Column('category', sa.String(length=100), nullable=True),
sa.Column('ready', sa.Boolean(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('goals_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['goals_id'], ['goals.id'], ),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('habits')
op.drop_table('notes')
op.drop_table('goals')
op.drop_table('projects')
op.drop_table('user')
# ### end Alembic commands ###