29 lines
941 B
Python
29 lines
941 B
Python
"""
|
|
Скрипт для создания таблиц системы проверок оборудования.
|
|
Создаёт только новые таблицы, не затрагивая существующие.
|
|
"""
|
|
|
|
from backend.database import engine
|
|
from backend.models import Base, InspectionSession, InspectionRecord, UnknownBarcode
|
|
|
|
|
|
def create_inspection_tables():
|
|
"""Создать таблицы для системы проверок"""
|
|
print("Creating inspection tables...")
|
|
|
|
# Создать только новые таблицы
|
|
Base.metadata.create_all(bind=engine, tables=[
|
|
InspectionSession.__table__,
|
|
InspectionRecord.__table__,
|
|
UnknownBarcode.__table__
|
|
])
|
|
|
|
print("Inspection tables created successfully!")
|
|
print("- inspection_sessions")
|
|
print("- inspection_records")
|
|
print("- unknown_barcodes")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
create_inspection_tables()
|