Skip to content

Commit

Permalink
remove migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Badmajor committed Aug 15, 2024
1 parent 2408974 commit f9104ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 54 deletions.
2 changes: 1 addition & 1 deletion alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ version_path_separator = os # Use os.pathsep. Default configuration used for ne
# are written from script.py.mako
# output_encoding = utf-8

sqlalchemy.url = %(DATABASE_DIALECT)s+%(DATABASE_DRIVER)s://%(POSTGRES_USER)s:%(POSTGRES_PASSWORD)s@%(POSTGRES_HOST)s:%(POSTGRES_PORT)s/%(POSTGRES_DB)s
sqlalchemy.url = ""



Expand Down
14 changes: 3 additions & 11 deletions alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,16 @@

from src.database import Base
from src.models import *

load_dotenv()
from src.config import DATABASE_DIALECT, DATABASE_DRIVER, DATABASE_USER, DATABASE_PASS, DATABASE_HOST, \
DATABASE_PORT, DATABASE_NAME

# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config

# Получите переменные окружения
database_dialect = os.getenv('DATABASE_DIALECT')
database_driver = os.getenv('DATABASE_DRIVER')
postgres_user = os.getenv('POSTGRES_USER')
postgres_password = os.getenv('POSTGRES_PASSWORD')
postgres_host = os.getenv('POSTGRES_HOST')
postgres_port = os.getenv('POSTGRES_PORT')
postgres_db = os.getenv('POSTGRES_DB')

# Формируйте строку подключения
sqlalchemy_url = f"{database_dialect}+{database_driver}://{postgres_user}:{postgres_password}@{postgres_host}:{postgres_port}/{postgres_db}?async_fallback=True"
sqlalchemy_url = f"{DATABASE_DIALECT}+{DATABASE_DRIVER}://{DATABASE_USER}:{DATABASE_PASS}@{DATABASE_HOST}:{DATABASE_PORT}/{DATABASE_NAME}?async_fallback=True"

# Установите строку подключения в конфиг
config.set_main_option('sqlalchemy.url', sqlalchemy_url)
Expand Down
42 changes: 0 additions & 42 deletions alembic/versions/15cbaa469cbd_create_inital_tables.py

This file was deleted.

0 comments on commit f9104ba

Please sign in to comment.