Updated db-scheme in schemes.drawio

This commit is contained in:
2026-02-08 11:34:13 +03:00
parent e92c7e3c6f
commit f60d4b7a78
2 changed files with 97 additions and 1 deletions

41
docker-compose.yml Normal file
View File

@@ -0,0 +1,41 @@
services:
postgres:
image: postgres:16-alpine
container_name: laura_postgres
environment:
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
POSTGRES_DB: ${DB_NAME:-giveawaybot}
ports:
- "${DB_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- laura_network
telegram-bot-api:
image: aiogram/telegram-bot-api:latest
container_name: laura_telegram_api
environment:
TELEGRAM_API_ID: ${TELEGRAM_API_ID:-}
TELEGRAM_API_HASH: ${TELEGRAM_API_HASH:-}
volumes:
- telegram_bot_api_data:/var/lib/telegram-bot-api
ports:
- "${TELEGRAM_API_PORT:-8081}:8081"
restart: unless-stopped
networks:
- laura_network
networks:
laura_network:
driver: bridge
volumes:
postgres_data:
telegram_bot_api_data:

View File

@@ -1,9 +1,64 @@
<mxfile host="65bd71144e" pages="2"> <mxfile host="65bd71144e" pages="2">
<diagram name="db-scheme" id="omqtpuhYFdzVFIHnakk7"> <diagram name="db-scheme" id="omqtpuhYFdzVFIHnakk7">
<mxGraphModel dx="702" dy="611" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" background="none" math="0" shadow="0"> <mxGraphModel dx="500" dy="291" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" background="none" math="0" shadow="0">
<root> <root>
<mxCell id="0"/> <mxCell id="0"/>
<mxCell id="1" parent="0"/> <mxCell id="1" parent="0"/>
<mxCell id="2" value="Base Model" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="344" y="20" width="140" height="120" as="geometry"/>
</mxCell>
<mxCell id="3" value="id BIGINT PRIMARY AUTOINCREMENT" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="30" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="4" value="created_at unixtime NOT NULL" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="60" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="5" value="&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;updated_at unixtime NOT NULL&lt;/span&gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="90" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="6" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" target="2">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="414" y="180" as="sourcePoint"/>
<mxPoint x="370" y="180" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="8" value="users" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="180" y="230" width="140" height="210" as="geometry"/>
</mxCell>
<mxCell id="9" value="telegram_id BIGINT NOT NULL" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="8">
<mxGeometry y="30" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="10" value="is_banned BOOLEAN NOT NULL DEFAULT FALSE" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="8">
<mxGeometry y="60" width="140" height="50" as="geometry"/>
</mxCell>
<mxCell id="11" value="is_receive BOOLEAN NOT NULL DEFAULT FALSE" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="8">
<mxGeometry y="110" width="140" height="50" as="geometry"/>
</mxCell>
<mxCell id="13" value="is_approved_statistics BOOLEAN NOT NULL DEFAULT FALSE" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="8">
<mxGeometry y="160" width="140" height="50" as="geometry"/>
</mxCell>
<mxCell id="14" value="users_actions" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="430" y="290" width="140" height="140" as="geometry"/>
</mxCell>
<mxCell id="15" value="user_id BIGINT NOT NULL" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="14">
<mxGeometry y="30" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="16" value="chat_type ENUM(private, group) NOT NULL" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="14">
<mxGeometry y="60" width="140" height="50" as="geometry"/>
</mxCell>
<mxCell id="17" value="Item 3" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" vertex="1" parent="14">
<mxGeometry y="110" width="140" height="30" as="geometry"/>
</mxCell>
<mxCell id="18" value="" style="endArrow=classic;startArrow=classic;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=0.995;exitY=0.06;exitDx=0;exitDy=0;exitPerimeter=0;rounded=0;curved=0;" edge="1" parent="1" source="8" target="15">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="340" y="330" as="sourcePoint"/>
<mxPoint x="440" y="350" as="targetPoint"/>
<Array as="points">
<mxPoint x="370" y="243"/>
<mxPoint x="370" y="335"/>
</Array>
</mxGeometry>
</mxCell>
</root> </root>
</mxGraphModel> </mxGraphModel>
</diagram> </diagram>