dev@locazia: fix metadata
This commit is contained in:
1 parent
3305d836f7
commit
ddb554bc80
4 files changed
+27
-1
No files matched your search
@@ -8,3 +8,4 @@ from app.core.models.user import User
|
||||
from app.core.models.wallet_connection import WalletConnection
|
||||
from app.core.models.messages import KnownTelegramMessage
|
||||
from app.core.models.user_activity import UserActivity
|
||||
from app.core.models.content.user_content import UserContent
|
||||
@@ -0,0 +1 @@
|
||||
from app.core.models.content.user_content import UserContent
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
from sqlalchemy import Column, BigInteger, Integer, String, ForeignKey, DateTime, JSON, Boolean
|
||||
from sqlalchemy.orm import relationship
|
||||
from app.core.models.base import AlchemyBase
|
||||
|
||||
|
||||
class UserContent(AlchemyBase):
|
||||
__tablename__ = 'users_content'
|
||||
|
||||
id = Column(Integer, autoincrement=True, primary_key=True)
|
||||
type = Column(String(128), nullable=False) # 'license_issuer', 'license_listen'
|
||||
onchain_address = Column(String(1024), nullable=True) # bind by this
|
||||
updated = Column(DateTime, nullable=False, default=0)
|
||||
|
||||
content_id = Column(Integer, ForeignKey('node_storage.id'), nullable=True)
|
||||
created = Column(DateTime, nullable=False, default=0)
|
||||
|
||||
meta = Column(JSON, nullable=False, default={})
|
||||
user_id = Column(Integer, ForeignKey('users.id'), nullable=False)
|
||||
wallet_connection_id = Column(Integer, ForeignKey('wallet_connections.id'), nullable=True)
|
||||
status = Column(String(64), nullable=False, default='active') # 'transaction_requested'
|
||||
|
||||
user = relationship('User', uselist=False, foreign_keys=[user_id])
|
||||
wallet_connection = relationship('WalletConnection', uselist=False, foreign_keys=[wallet_connection_id])
|
||||
content = relationship('StoredContent', uselist=False, foreign_keys=[content_id])
|
||||
Reference in new issue
Block a user