PySimpleSocial/orm/__init__.py

15 lines
373 B
Python
Raw Normal View History

2022-10-04 21:13:26 +02:00
import asyncio
from piccolo.table import create_db_tables
from .users import User
from .media import Media
async def create_tables():
"""
Initializes the database
"""
await create_db_tables(User, Media, if_not_exists=True)
await User.create_index([User.public_id], if_not_exists=True)
await User.create_index([User.username], if_not_exists=True)