Skip to content

Instantly share code, notes, and snippets.

@AEnterprise
Created October 15, 2019 09:08
Show Gist options
  • Save AEnterprise/3256c81c0eb2adb4b4dcd1018e04e559 to your computer and use it in GitHub Desktop.
Save AEnterprise/3256c81c0eb2adb4b4dcd1018e04e559 to your computer and use it in GitHub Desktop.
class LoggedMessage(Model):
id = BigIntField(pk=True, generated=False) # RENAMED FROM messageid
content = CharField(max_length=2000, collation="utf8mb4_general_ci", null=True)
author = BigIntField()
channel = BigIntField()
server = BigIntField()
type = IntField(null=True)
pinned = BooleanField(default=False)
class LoggedAttachment(Model):
id = BigIntField(pk=True, generated=False)
name = CharField(max_length=100)
isImage = BooleanField()
message = ForeignKeyField("models.LoggedMessage", related_name="attachments") # RENAMED FROM messageid
class CustomCommand(Model):
id = IntField(pk=True)
serverid = BigIntField()
trigger = CharField(max_length=20, collation="utf8mb4_general_ci")
response = CharField(max_length=2000, collation="utf8mb4_general_ci")
class Infraction(Model):
id = IntField(pk=True)
guild_id = BigIntField()
user_id = BigIntField()
mod_id = BigIntField()
type = CharField(max_length=10, collation="utf8mb4_general_ci")
reason = CharField(max_length=2000, collation="utf8mb4_general_ci")
start = DatetimeField()
end = DatetimeField(null=True)
active = BooleanField(default=True)
class InfractionMigration(Model):
id = IntField(pk=True)
guild_id = BigIntField()
user_id = BigIntField()
mod_id = BigIntField()
type = CharField(max_length=10, collation="utf8mb4_general_ci")
reason = CharField(max_length=2000, collation="utf8mb4_general_ci")
start = IntField()
end = BigIntField(null=True)
active = BooleanField(default=True)
class Meta:
table = "infraction"
class Reminder(Model):
id = IntField(pk=True)
user_id = BigIntField()
channel_id = BigIntField()
guild_id = CharField(max_length=20)
message_id = BigIntField()
dm = BooleanField()
to_remind = CharField(max_length=1800, collation="utf8mb4_general_ci")
send = DatetimeField()
time = DatetimeField()
# status = EnumField(ReminderStatus)
class Raid(Model):
id = IntField(pk=True)
guild_id = BigIntField()
start = DatetimeField()
end = DatetimeField(null=True)
class Raider(Model):
id = IntField(pk=True)
raid = ForeignKeyField("models.Raid", related_name="raiders")
user_id = BigIntField()
joined_at = DatetimeField()
class RaidAction(Model):
id = IntField(pk=True)
raider = ForeignKeyField("models.Raider", related_name="actions_taken")
action = CharField(max_length=20)
infraction = ForeignKeyField("models.Infraction", related_name="RaiderActions", null=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment