init
This commit is contained in:
14
models.py
Normal file
14
models.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from sqlalchemy import Column, Integer, String, UniqueConstraint
|
||||
from database import Base
|
||||
|
||||
class Counter(Base):
|
||||
__tablename__ = "counters"
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
namespace = Column(String, index=True, nullable=False)
|
||||
application = Column(String, index=True, nullable=False)
|
||||
version = Column(String, index=True, nullable=False)
|
||||
value = Column(Integer, default=0, nullable=False)
|
||||
|
||||
__table_args__ = (
|
||||
UniqueConstraint('namespace', 'application', 'version', name='_namespace_application_version_uc'),
|
||||
)
|
||||
Reference in New Issue
Block a user