fix: widen house_factor precision in Customer_estimate_gallons model

Updated DECIMAL(5,2) to DECIMAL(7,4) to match the DB column (now altered
to NUMERIC(7,4)) and the auto.py model — prevents calibrated K-factors from
being silently truncated to 2 decimal places on read/write.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-18 15:05:38 -04:00
parent 3066754821
commit 60f9eee202
+18 -1
View File
@@ -156,7 +156,7 @@ class Customer_estimate_gallons(db.Model):
estimated_gallons_left_prev_day = db.Column(db.DECIMAL(6, 2))
tank_height = db.Column(db.VARCHAR(25))
tank_size = db.Column(db.VARCHAR(25))
house_factor = db.Column(db.DECIMAL(5, 2))
house_factor = db.Column(db.DECIMAL(7, 4))
auto_status = db.Column(db.INTEGER)
open_ticket_id = db.Column(db.Integer, nullable=True)
hot_water_summer = db.Column(db.INTEGER)
@@ -182,3 +182,20 @@ class Customer_Update(db.Model):
class Customer_Update_schema(ma.SQLAlchemyAutoSchema):
class Meta:
model = Customer_Update
class Customer_Alert(db.Model):
__tablename__ = 'customer_alert'
__table_args__ = {"schema": "public"}
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
customer_id = db.Column(db.INTEGER, nullable=False)
# 0 = info, 1 = notice, 2 = critical
severity = db.Column(db.INTEGER, nullable=False)
message = db.Column(db.VARCHAR(2000), nullable=False)
created_at = db.Column(db.TIMESTAMP())
class Customer_Alert_schema(ma.SQLAlchemyAutoSchema):
class Meta:
model = Customer_Alert