20 lines
433 B
Python
20 lines
433 B
Python
|
|
#!/usr/bin/env python3
|
||
|
|
"""
|
||
|
|
创建数据库表的脚本
|
||
|
|
"""
|
||
|
|
|
||
|
|
import sys
|
||
|
|
import os
|
||
|
|
import asyncio
|
||
|
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||
|
|
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'backend'))
|
||
|
|
|
||
|
|
from backend.models.database import init_db
|
||
|
|
|
||
|
|
def main():
|
||
|
|
print("正在创建数据库表...")
|
||
|
|
init_db()
|
||
|
|
print("数据库表创建完成!")
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
main()
|