From fe6abd8a5719cbcab1d1207918136f19042e4fa3 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Mon, 19 Aug 2024 01:05:27 +0100 Subject: Add debug endpoints and implement token auth Co-authored-by: Joe Banks --- thallium-backend/scripts/seed.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 thallium-backend/scripts/seed.py (limited to 'thallium-backend/scripts/seed.py') diff --git a/thallium-backend/scripts/seed.py b/thallium-backend/scripts/seed.py new file mode 100644 index 0000000..b27a586 --- /dev/null +++ b/thallium-backend/scripts/seed.py @@ -0,0 +1,20 @@ +import asyncio + +from src.orm import Voucher +from src.settings import Connections + + +async def main() -> None: + """Seed the database with some test data.""" + async with Connections.DB_SESSION_MAKER() as session, session.begin(): + session.add_all( + [ + Voucher(voucher_code="k1p", balance="13.37", active=False), + Voucher(voucher_code="k1p", balance="13.37", active=False), + Voucher(voucher_code="k1p", balance="13.37"), + ] + ) + + +if __name__ == "__main__": + asyncio.run(main()) -- cgit v1.2.3