From e4094bbda79296930a35439ede8796284de5ca6c Mon Sep 17 00:00:00 2001 From: RhinosF1 Date: Sun, 29 May 2022 19:24:28 +0100 Subject: [PATCH] db: use Text where length not limited Fixes #2291 --- sopel/db.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sopel/db.py b/sopel/db.py index 8981eefa03..11016213f4 100644 --- a/sopel/db.py +++ b/sopel/db.py @@ -7,7 +7,7 @@ import traceback import typing -from sqlalchemy import Column, create_engine, ForeignKey, Integer, String +from sqlalchemy import Column, create_engine, ForeignKey, Integer, String, Text from sqlalchemy.engine.url import make_url, URL from sqlalchemy.exc import OperationalError, SQLAlchemyError from sqlalchemy.ext.declarative import declarative_base @@ -62,8 +62,8 @@ class NickValues(BASE): __tablename__ = 'nick_values' __table_args__ = MYSQL_TABLE_ARGS nick_id = Column(Integer, ForeignKey('nick_ids.nick_id'), primary_key=True) - key = Column(String(255), primary_key=True) - value = Column(String(255)) + key = Column(Text, primary_key=True) + value = Column(Text) class ChannelValues(BASE): @@ -71,17 +71,17 @@ class ChannelValues(BASE): __tablename__ = 'channel_values' __table_args__ = MYSQL_TABLE_ARGS channel = Column(String(255), primary_key=True) - key = Column(String(255), primary_key=True) - value = Column(String(255)) + key = Column(Text, primary_key=True) + value = Column(Text) class PluginValues(BASE): """Plugin values table SQLAlchemy class.""" __tablename__ = 'plugin_values' __table_args__ = MYSQL_TABLE_ARGS - plugin = Column(String(255), primary_key=True) - key = Column(String(255), primary_key=True) - value = Column(String(255)) + plugin = Column(Text, primary_key=True) + key = Column(Text, primary_key=True) + value = Column(Text) class SopelDB: