2026-05-12 23:58:18 +00:00
|
|
|
from extensions import db
|
|
|
|
|
|
|
|
|
|
class Favorite(db.Model):
|
|
|
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
|
|
|
user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
|
|
|
|
|
notepad_id = db.Column(db.Integer, db.ForeignKey('notepad.id'), nullable=False)
|
|
|
|
|
|
|
|
|
|
__table_args__ = (
|
|
|
|
|
db.UniqueConstraint('user_id', 'notepad_id', name='unique_favorite'),
|
2026-06-23 19:06:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
def __init__(self, **kwargs):
|
|
|
|
|
super().__init__(**kwargs)
|