Dispensing Vet
This commit is contained in:
@@ -230,6 +230,10 @@ def migrate_compliance_schema() -> None:
|
||||
)
|
||||
print("Backfilled dispensing mode where missing")
|
||||
|
||||
if _table_exists(cursor, "dispensings") and not _column_exists(cursor, "dispensings", "prescribing_vet"):
|
||||
cursor.execute("ALTER TABLE dispensings ADD COLUMN prescribing_vet VARCHAR")
|
||||
print("Added dispensings.prescribing_vet")
|
||||
|
||||
# Seed default locations once table exists (created via SQLAlchemy create_all).
|
||||
if _table_exists(cursor, "locations"):
|
||||
cursor.execute("INSERT OR IGNORE INTO locations(name, is_active) VALUES ('Cupboard', 1)")
|
||||
|
||||
@@ -60,6 +60,7 @@ class Dispensing(Base):
|
||||
requested_pack_id = Column(Integer, ForeignKey("variant_packs.id"), nullable=True)
|
||||
requested_pack_count = Column(Float, nullable=True)
|
||||
animal_name = Column(String, nullable=True) # Name/ID of the animal (optional)
|
||||
prescribing_vet = Column(String, nullable=True) # Prescribing vet's name (required for controlled drugs)
|
||||
user_name = Column(String, nullable=False) # User who dispensed
|
||||
dispensed_at = Column(DateTime(timezone=True), server_default=func.now(), index=True)
|
||||
notes = Column(String, nullable=True)
|
||||
|
||||
Reference in New Issue
Block a user