class Admin(Model): id: Integer(primary_key=True) = None email: Text(unique=True) passhash: Text() class Mapping(Mapping): table_name = 'admins'
class Hood(Model): id: Integer(primary_key=True) = None name: Text(unique=True) landingpage: Text() email_enabled: Boolean() = True class Mapping(Mapping): table_name = 'hoods'
class Email(Model): """ This table is used to track the names. It also stores the token secret. """ id: Integer(primary_key=True) = None hood: ForeignKey(Hood) name: Text(unique=True) secret: Text() class Mapping(Mapping): table_name = 'email'
class Telegram(Model): id: Integer(primary_key=True) = None hood: ForeignKey(Hood) api_token: Text(unique=True) welcome_message: Text() username: Text(allow_null=True) = None enabled: Boolean() = True class Mapping(Mapping): table_name = 'telegrambots'
class Twitter(Model): id: Integer(primary_key=True) = None hood: ForeignKey(Hood) dms_since_id: Integer(allow_null=True) = None mentions_since_id: Integer(allow_null=True) = None access_token: Text() access_token_secret: Text() username: Text(allow_null=True) = None verified: Boolean() = False enabled: Boolean() = False class Mapping(Mapping): table_name = 'twitterbots'
class BadWord(Model): id: Integer(primary_key=True) = None hood: ForeignKey(Hood) pattern: Text() class Mapping(Mapping): table_name = 'badwords'
class Trigger(Model): id: Integer(primary_key=True) = None hood: ForeignKey(Hood) pattern: Text() class Mapping(Mapping): table_name = 'triggers'
class EmailSubscribers(Model): """ This table stores all subscribers, who want to receive messages via email. """ id: Integer(primary_key=True) = None hood: ForeignKey(Hood) email: Text(unique=True) class Mapping(Mapping): table_name = 'email_subscribers'