aboutsummaryrefslogtreecommitdiff
path: root/alembic/versions/1627487324fd_init_database.py
diff options
context:
space:
mode:
authorTolmachev Igor <me@igorek.dev>2026-03-23 22:17:24 +0300
committerTolmachev Igor <me@igorek.dev>2026-03-23 22:17:24 +0300
commit0444ff325490f24e9a8d35f83ba37a0bd95ab6c5 (patch)
tree5eb8bef05078002edfc14d26386d5931efa805a0 /alembic/versions/1627487324fd_init_database.py
parent0884a8230ecad2cedd31c66ea2b1f4c460fba3cb (diff)
downloadvpn_manager_bot-0444ff325490f24e9a8d35f83ba37a0bd95ab6c5.tar.gz
vpn_manager_bot-0444ff325490f24e9a8d35f83ba37a0bd95ab6c5.zip
Add pay_invoice button
Diffstat (limited to 'alembic/versions/1627487324fd_init_database.py')
-rw-r--r--alembic/versions/1627487324fd_init_database.py72
1 files changed, 0 insertions, 72 deletions
diff --git a/alembic/versions/1627487324fd_init_database.py b/alembic/versions/1627487324fd_init_database.py
deleted file mode 100644
index f25277f..0000000
--- a/alembic/versions/1627487324fd_init_database.py
+++ /dev/null
@@ -1,72 +0,0 @@
1"""init database
2
3Revision ID: 1627487324fd
4Revises:
5Create Date: 2026-03-23 18:33:08.493629
6
7"""
8
9from typing import Sequence, Union
10
11import sqlalchemy as sa
12
13from alembic import op
14
15# revision identifiers, used by Alembic.
16revision: str = "1627487324fd"
17down_revision: Union[str, Sequence[str], None] = None
18branch_labels: Union[str, Sequence[str], None] = None
19depends_on: Union[str, Sequence[str], None] = None
20
21
22def upgrade() -> None:
23 """Upgrade schema."""
24 # ### commands auto generated by Alembic - please adjust! ###
25 op.create_table(
26 "announcement",
27 sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
28 sa.Column("message", sa.JSON(), nullable=False),
29 sa.Column("datetime", sa.DateTime(), nullable=False),
30 sa.PrimaryKeyConstraint("id", name=op.f("pk_announcement")),
31 )
32 op.create_table(
33 "invoice",
34 sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
35 sa.Column("message", sa.JSON(), nullable=False),
36 sa.Column("datetime", sa.DateTime(), nullable=False),
37 sa.PrimaryKeyConstraint("id", name=op.f("pk_invoice")),
38 )
39 op.create_table(
40 "user",
41 sa.Column("id", sa.Integer(), autoincrement=False, nullable=False),
42 sa.Column("role", sa.Enum("REGULAR", "ADMIN", name="userrole"), nullable=False),
43 sa.Column("vpn_link", sa.String(), nullable=False),
44 sa.Column("datetime", sa.DateTime(), nullable=False),
45 sa.PrimaryKeyConstraint("id", name=op.f("pk_user")),
46 )
47 op.create_table(
48 "payment",
49 sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
50 sa.Column("user_id", sa.Integer(), nullable=False),
51 sa.Column("invoice_id", sa.Integer(), nullable=False),
52 sa.Column("receipt_file_id", sa.String(), nullable=False),
53 sa.Column("datetime", sa.DateTime(), nullable=False),
54 sa.ForeignKeyConstraint(
55 ["invoice_id"], ["invoice.id"], name=op.f("fk_payment_invoice_id_invoice")
56 ),
57 sa.ForeignKeyConstraint(
58 ["user_id"], ["user.id"], name=op.f("fk_payment_user_id_user")
59 ),
60 sa.PrimaryKeyConstraint("id", name=op.f("pk_payment")),
61 )
62 # ### end Alembic commands ###
63
64
65def downgrade() -> None:
66 """Downgrade schema."""
67 # ### commands auto generated by Alembic - please adjust! ###
68 op.drop_table("payment")
69 op.drop_table("user")
70 op.drop_table("invoice")
71 op.drop_table("announcement")
72 # ### end Alembic commands ###