mirror of
https://github.com/sstent/aicyclingcoach-go.git
synced 2026-01-26 00:51:56 +00:00
12 lines
445 B
Python
12 lines
445 B
Python
from sqlalchemy import Column, Integer, ForeignKey
|
|
from sqlalchemy.orm import relationship
|
|
from .base import BaseModel
|
|
|
|
class PlanRule(BaseModel):
|
|
__tablename__ = "plan_rules"
|
|
|
|
plan_id = Column(Integer, ForeignKey('plans.id'), primary_key=True)
|
|
rule_id = Column(Integer, ForeignKey('rules.id'), primary_key=True)
|
|
|
|
plan = relationship("Plan", back_populates="rules")
|
|
rule = relationship("Rule", back_populates="plans") |