Skip to content
This repository has been archived by the owner on Dec 29, 2021. It is now read-only.

BLOB/TEXT column 'md5_digest' used in key specification without a key length #12

Open
Soberia opened this issue Oct 21, 2019 · 1 comment

Comments

@Soberia
Copy link

Soberia commented Oct 21, 2019

OperationalError rasies when try to a create a container with AlchemySessionContainer() with MySQL database:

sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1170, "BLOB/TEXT column 'md5_digest' used in key specification without a key length")

[SQL: CREATE TABLE sent_files ( session_id VARCHAR(255) NOT NULL, md5_digest BLOB NOT NULL, file_size INTEGER NOT NULL, type INTEGER NOT NULL, id BIGINT, hash BIGINT, PRIMARY KEY (session_id, md5_digest, file_size, type)

Telethon v1.10.6
SQLAlchemy v1.3.10 (Dialect = MySQL v8.0.18, Driver = mysqlclient v1.4.4)
telethon-session-sqlalchemy v0.2.15

@kolayne
Copy link

kolayne commented Jun 22, 2020

Can reproduce this issue too. Telethon 1.14.0, SQLAlchemy 1.3.11, telethon-session-sqlalchemy 0.2.15

Can be solved by manually creating tables and passing manage_tables=False to AlchemySessionContainer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants