# Copyright (C) 2020 by Thomas Lindner # Copyright (C) 2020 by Martin Rey # # SPDX-License-Identifier: 0BSD from ormantic import ForeignKey, Integer, Text, Boolean, Model from kibicara.model import Hood, Mapping class MastodonInstance(Model): id: Integer(primary_key=True) = None name: Text() client_id: Text() client_secret: Text() class Mapping(Mapping): table_name = 'mastodoninstances' class MastodonAccount(Model): id: Integer(primary_key=True) = None hood: ForeignKey(Hood) instance: ForeignKey(MastodonInstance) access_token: Text() enabled: Boolean() = False last_seen: Text() class Mapping(Mapping): table_name = 'mastodonaccounts'