more crap
This commit is contained in:
@ -1,17 +1,20 @@
|
||||
from datetime import datetime
|
||||
from app import db
|
||||
|
||||
|
||||
class Submission(db.Model):
|
||||
__tablename__ = 'submissions'
|
||||
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
user_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)
|
||||
plant_id = db.Column(db.Integer, db.ForeignKey('plants.id'), nullable=True)
|
||||
|
||||
common_name = db.Column(db.String(120), nullable=False)
|
||||
scientific_name = db.Column(db.String(120))
|
||||
price = db.Column(db.Float, nullable=False)
|
||||
source = db.Column(db.String(120))
|
||||
timestamp = db.Column(db.DateTime, default=datetime.utcnow)
|
||||
|
||||
height = db.Column(db.Float)
|
||||
width = db.Column(db.Float)
|
||||
leaf_count = db.Column(db.Integer)
|
||||
@ -19,6 +22,8 @@ class Submission(db.Model):
|
||||
container_size = db.Column(db.String(120))
|
||||
health_status = db.Column(db.String(50))
|
||||
notes = db.Column(db.Text)
|
||||
|
||||
# Image references via SubmissionImage table
|
||||
images = db.relationship('SubmissionImage', backref='submission', lazy=True)
|
||||
|
||||
|
||||
@ -29,21 +34,3 @@ class SubmissionImage(db.Model):
|
||||
submission_id = db.Column(db.Integer, db.ForeignKey('submissions.id'), nullable=False)
|
||||
file_path = db.Column(db.String(255), nullable=False)
|
||||
is_visible = db.Column(db.Boolean, default=True)
|
||||
|
||||
|
||||
class ImageHeart(db.Model):
|
||||
__tablename__ = 'image_hearts'
|
||||
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
user_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)
|
||||
submission_image_id = db.Column(db.Integer, db.ForeignKey('submission_images.id'), nullable=False)
|
||||
created_at = db.Column(db.DateTime, default=datetime.utcnow)
|
||||
|
||||
|
||||
class FeaturedImage(db.Model):
|
||||
__tablename__ = 'featured_images'
|
||||
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
submission_image_id = db.Column(db.Integer, db.ForeignKey('submission_images.id'), nullable=False)
|
||||
override_text = db.Column(db.String(255), nullable=True)
|
||||
is_featured = db.Column(db.Boolean, default=True)
|
||||
|
Reference in New Issue
Block a user