add proverka func
This commit is contained in:
28
backend/create_inspection_tables.py
Normal file
28
backend/create_inspection_tables.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
Скрипт для создания таблиц системы проверок оборудования.
|
||||
Создаёт только новые таблицы, не затрагивая существующие.
|
||||
"""
|
||||
|
||||
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()
|
||||
Reference in New Issue
Block a user