PySimpleSocial/orm/__init__.py

16 lines
442 B
Python

import asyncio
from piccolo.table import create_db_tables
from .users import User
from .media import Media
from .email_verification import EmailVerification
async def create_tables():
"""
Initializes the database
"""
await create_db_tables(User, Media, EmailVerification, 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)