tons of fun

This commit is contained in:
2025-06-04 01:40:12 -05:00
parent e8acd6bb20
commit c885ede8af
18 changed files with 206 additions and 209 deletions

View File

@ -1,12 +1,14 @@
from datetime import datetime
from app import db
from plugins.plant.models import Plant
class GrowLog(db.Model):
__tablename__ = 'grow_logs'
__table_args__ = {'extend_existing': True}
id = db.Column(db.Integer, primary_key=True)
plant_id = db.Column(db.Integer, db.ForeignKey('plants.id'), nullable=False)
plant_id = db.Column(db.Integer, db.ForeignKey('plant.id'), nullable=False)
title = db.Column(db.String(255), nullable=False)
created_at = db.Column(db.DateTime, default=datetime.utcnow)
@ -18,7 +20,7 @@ class PlantUpdate(db.Model):
__table_args__ = {'extend_existing': True}
id = db.Column(db.Integer, primary_key=True)
plant_id = db.Column(db.Integer, db.ForeignKey('plants.id'), nullable=False)
plant_id = db.Column(db.Integer, db.ForeignKey('plant.id'), nullable=False)
growlog_id = db.Column(db.Integer, db.ForeignKey('grow_logs.id'), nullable=True)
update_type = db.Column(db.String(50), nullable=False)
description = db.Column(db.Text, nullable=True)