Creating a new database
This commit is contained in:
@@ -84,7 +84,7 @@ path_separator = os
|
||||
# database URL. This is consumed by the user-maintained env.py script only.
|
||||
# other means of configuring database URLs may be customized within the env.py
|
||||
# file.
|
||||
sqlalchemy.url = sqlite+aiosqlite:///./database/dbases/stcs.db
|
||||
sqlalchemy.url = sqlite+aiosqlite:///./database/dbs/stcs.db
|
||||
|
||||
|
||||
[post_write_hooks]
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
"""Create new database
|
||||
|
||||
Revision ID: dd8d3ee75389
|
||||
Revises:
|
||||
Create Date: 2025-11-09 15:16:52.424676
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'dd8d3ee75389'
|
||||
down_revision: Union[str, Sequence[str], None] = None
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
# ### end Alembic commands ###
|
||||
@@ -10,7 +10,7 @@ logging.config.dictConfig(LOGGING_CONFIG)
|
||||
logger = logging.getLogger("database")
|
||||
|
||||
BASE_DIR = Path(__file__).parent.resolve()
|
||||
DATA_DIR = BASE_DIR / "dbases"
|
||||
DATA_DIR = BASE_DIR / "dbs"
|
||||
DATA_DIR.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
DATABASE_URL = f"sqlite+aiosqlite:///{DATA_DIR / 'stcs.db'}"
|
||||
|
||||
Reference in New Issue
Block a user