Infrastructure: Implement master/dev/vX branching, save git path, and fix username casing
This commit is contained in:
@@ -8,10 +8,20 @@ class User(Base):
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
username = Column(String, unique=True, index=True)
|
||||
hashed_password = Column(String, nullable=True) # Nullable for LDAP or legacy users
|
||||
role = Column(String, default="user") # 'admin' or 'user'
|
||||
|
||||
audit_logs = relationship("AuditLog", back_populates="user")
|
||||
|
||||
class Category(Base):
|
||||
__tablename__ = "categories"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
name = Column(String, unique=True, index=True)
|
||||
description = Column(String, nullable=True)
|
||||
|
||||
items = relationship("Item", back_populates="category_rel")
|
||||
|
||||
class Item(Base):
|
||||
__tablename__ = "items"
|
||||
|
||||
@@ -19,11 +29,18 @@ class Item(Base):
|
||||
barcode = Column(String, unique=True, index=True)
|
||||
name = Column(String, index=True)
|
||||
category = Column(String, index=True)
|
||||
category_id = Column(Integer, ForeignKey("categories.id"), nullable=True)
|
||||
type = Column(String, index=True, nullable=True)
|
||||
|
||||
category_rel = relationship("Category", back_populates="items")
|
||||
part_number = Column(String, index=True, nullable=True)
|
||||
color = Column(String, index=True, nullable=True)
|
||||
specs = Column(Text, nullable=True)
|
||||
quantity = Column(Float, default=0.0)
|
||||
min_quantity = Column(Float, default=1.0)
|
||||
image_url = Column(String, nullable=True)
|
||||
|
||||
# Store labels template extracted data simply as JSON text for now
|
||||
# Full AI metadata
|
||||
labels_data = Column(Text, nullable=True)
|
||||
|
||||
class AuditLog(Base):
|
||||
@@ -35,6 +52,8 @@ class AuditLog(Base):
|
||||
action = Column(String) # e.g., 'CHECK_IN', 'CHECK_OUT', 'CREATE_ITEM'
|
||||
target_item_id = Column(Integer, nullable=True)
|
||||
quantity_change = Column(Float, nullable=True)
|
||||
uuid = Column(String, unique=True, index=True, nullable=True)
|
||||
details = Column(Text, nullable=True) # For reasons, sync notes, etc.
|
||||
|
||||
user = relationship("User", back_populates="audit_logs")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user