Skip to content

Commit 51d814b

Browse files
committed
Set up PostgreSQL users table and database schema
1 parent 24de930 commit 51d814b

12 files changed

Lines changed: 91 additions & 3 deletions

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sqlalchemy.url = postgresql://postgres:password@localhost:5432/notifications
1+
DATABASE_URL=postgresql://postgres:password@localhost:5432/notifications

alembic.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[alembic]
22
script_location = %(here)s/alembic
33

4-
sqlalchemy.url = postgresql://postgres:password@localhost:5432/notifications
5-
64
# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
75
# Uncomment the line below if you want the files to be prepended with date and time
86
# see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
298 Bytes
Binary file not shown.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""create users table
2+
3+
Revision ID: 6bf8780a34f5
4+
Revises:
5+
Create Date: 2026-02-09 11:39:02.071246
6+
7+
"""
8+
from typing import Sequence, Union
9+
10+
from alembic import op
11+
import sqlalchemy as sa
12+
13+
14+
# revision identifiers, used by Alembic.
15+
revision: str = '6bf8780a34f5'
16+
down_revision: Union[str, Sequence[str], None] = None
17+
branch_labels: Union[str, Sequence[str], None] = None
18+
depends_on: Union[str, Sequence[str], None] = None
19+
20+
21+
def upgrade() -> None:
22+
"""Upgrade schema."""
23+
pass
24+
25+
26+
def downgrade() -> None:
27+
"""Downgrade schema."""
28+
pass
Binary file not shown.
160 Bytes
Binary file not shown.
746 Bytes
Binary file not shown.
925 Bytes
Binary file not shown.
1.02 KB
Binary file not shown.

app/config.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from pydantic_settings import BaseSettings
2+
3+
4+
class Settings(BaseSettings):
5+
DATABASE_URL: str
6+
7+
class Config:
8+
env_file = ".env"
9+
10+
11+
settings = Settings()

0 commit comments

Comments
 (0)