astronomer / astronomer-airflow-version-check

Plugin to check if new version of Astronomer Certified Airflow is available
Apache License 2.0
1 stars 2 forks source link

Updated text type of primary key for version table #16

Closed rob2244 closed 3 years ago

rob2244 commented 3 years ago

It seems like mysql doesn't like unbounded character text types as a primary key. For mysql/maria table creation fails with the following:

sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1170, "BLOB/TEXT column 'version' used in key specification without a key length") [SQL: CREATE TABLE astro_available_version ( version TEXT NOT NULL, level TEXT NOT NULL, date_released DATETIME NOT NULL, description TEXT, url TEXT, hidden_from_ui BOOL NOT NULL, PRIMARY KEY (version), CHECK (hidden_from_ui IN (0, 1)) )

Per this post: https://stackoverflow.com/questions/1827063/mysql-error-key-specification-without-a-key-length I updated the primary key type from an unbounded text type to String(255) which fixes the issue.

kaxil commented 3 years ago

I have updated the PR and pushed another commit to make it backwards compatible