db867dcbe5
Deploy to Staging / deploy (push) Has been cancelled
Conflict detector / main (push) Has been cancelled
Lint Backend / lint-backend (push) Has been cancelled
Playwright Tests / changes (push) Has been cancelled
Test Backend / test-backend (push) Has been cancelled
Test Docker Compose / test-docker-compose (push) Has been cancelled
Playwright Tests / test-playwright (1, 4) (push) Has been cancelled
Playwright Tests / test-playwright (2, 4) (push) Has been cancelled
Playwright Tests / test-playwright (3, 4) (push) Has been cancelled
Playwright Tests / test-playwright (4, 4) (push) Has been cancelled
Playwright Tests / merge-playwright-reports (push) Has been cancelled
Playwright Tests / alls-green-playwright (push) Has been cancelled
Issue Manager / issue-manager (push) Has been cancelled
24 lines
409 B
Python
24 lines
409 B
Python
import logging
|
|
|
|
from sqlmodel import Session
|
|
|
|
from app.core.db import engine, init_db
|
|
|
|
logging.basicConfig(level=logging.INFO)
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def init() -> None:
|
|
with Session(engine) as session:
|
|
init_db(session)
|
|
|
|
|
|
def main() -> None:
|
|
logger.info("正在创建初始数据")
|
|
init()
|
|
logger.info("初始数据创建完成")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|