mirror of
https://github.com/Alexander-D-Karpov/akarpov
synced 2024-11-22 22:36:34 +03:00
19 lines
515 B
Python
19 lines
515 B
Python
|
from sqlalchemy import Boolean, Column, DateTime, Integer, String
|
||
|
|
||
|
from redirect.db import Base
|
||
|
|
||
|
|
||
|
class Link(Base):
|
||
|
"""Model of a short link that defines slug and target of a redirect."""
|
||
|
|
||
|
__tablename__ = "short_link"
|
||
|
|
||
|
id = Column(Integer, primary_key=True, index=True)
|
||
|
created = Column(DateTime)
|
||
|
modified = Column(DateTime)
|
||
|
source = Column(String)
|
||
|
slug = Column(String, index=True)
|
||
|
enabled = Column(Boolean)
|
||
|
viewed = Column(Integer)
|
||
|
creator_id = Column(Integer, index=True)
|