blob: b27a5867cc0f1d596d8af534ef0c55bdb49ee701 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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())
|