upd
This commit is contained in:
1 parent
373c832e71
commit
1b0dfdafbc
48 files changed
+3114
-396
No files matched your search
@@ -1 +0,0 @@
|
||||
from app.core.models.content.user_content import UserContent
|
||||
@@ -1,48 +1,43 @@
|
||||
|
||||
from sqlalchemy import Column, BigInteger, Integer, String, ForeignKey, DateTime, JSON, Boolean
|
||||
from datetime import datetime
|
||||
from sqlalchemy import Column, BigInteger, Integer, String, ForeignKey, JSON, Boolean
|
||||
from sqlalchemy.dialects.postgresql import TIMESTAMP
|
||||
from sqlalchemy.orm import relationship
|
||||
from app.core.models.base import AlchemyBase
|
||||
from app.core.models.content.indexation_mixins import UserContentIndexationMixin
|
||||
from app.core.models.base import BaseModel
|
||||
|
||||
|
||||
class UserContent(AlchemyBase, UserContentIndexationMixin):
|
||||
class UserContent(BaseModel):
|
||||
__tablename__ = 'users_content'
|
||||
|
||||
id = Column(Integer, autoincrement=True, primary_key=True)
|
||||
type = Column(String(128), nullable=False) # 'license/issuer', 'license/listen', 'nft/unknown'
|
||||
onchain_address = Column(String(1024), nullable=True) # bind by this
|
||||
# Legacy compatibility fields
|
||||
type = Column(String(128), nullable=False, default='license/listen')
|
||||
onchain_address = Column(String(1024), nullable=True)
|
||||
owner_address = Column(String(1024), nullable=True)
|
||||
code_hash = Column(String(128), nullable=True)
|
||||
data_hash = Column(String(128), nullable=True)
|
||||
updated = Column(DateTime, nullable=False, default=0)
|
||||
|
||||
content_id = Column(Integer, ForeignKey('node_storage.id'), nullable=True)
|
||||
created = Column(DateTime, nullable=False, default=0)
|
||||
content_id = Column(String(36), ForeignKey('my_network_content.id'), nullable=True)
|
||||
|
||||
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'
|
||||
meta = Column(JSON, nullable=False, default=dict)
|
||||
user_id = Column(String(36), ForeignKey('users.id'), nullable=False)
|
||||
wallet_connection_id = Column(String(36), ForeignKey('wallet_connections.id'), nullable=True)
|
||||
|
||||
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])
|
||||
|
||||
|
||||
class UserAction(AlchemyBase):
|
||||
class UserAction(BaseModel):
|
||||
__tablename__ = 'users_actions'
|
||||
|
||||
id = Column(Integer, autoincrement=True, primary_key=True)
|
||||
type = Column(String(128), nullable=False) # 'purchase'
|
||||
user_id = Column(Integer, ForeignKey('users.id'), nullable=False)
|
||||
content_id = Column(Integer, ForeignKey('node_storage.id'), nullable=True)
|
||||
user_id = Column(String(36), ForeignKey('users.id'), nullable=False)
|
||||
content_id = Column(String(36), ForeignKey('my_network_content.id'), nullable=True)
|
||||
telegram_message_id = Column(BigInteger, nullable=True)
|
||||
|
||||
to_address = Column(String(1024), nullable=True)
|
||||
from_address = Column(String(1024), nullable=True)
|
||||
status = Column(String(128), nullable=True)
|
||||
meta = Column(JSON, nullable=False, default={})
|
||||
created = Column(DateTime, nullable=False, default=0)
|
||||
meta = Column(JSON, nullable=False, default=dict)
|
||||
|
||||
user = relationship('User', uselist=False, foreign_keys=[user_id])
|
||||
content = relationship('StoredContent', uselist=False, foreign_keys=[content_id])
|
||||
|
||||
Reference in new issue
Block a user