teamhanko / hanko

Authentication and user management system with passkey superpowers
https://hanko.io
Other
5.56k stars 792 forks source link

MySQL migration fails: column 'cert_data' used in key specification without a key length #1492

Open mardu opened 3 weeks ago

mardu commented 3 weeks ago

Checklist

Describe the bug

Trying to run migration for MySQL version 8.4.0 fails with error:

error executing migrations/20230915111552_create_saml_certs.up.fizz, sql: CREATE TABLE `saml_certificates` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`cert_data` text NOT NULL,
`cert_key` text NOT NULL,
`encryption_key` VARCHAR (255) NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL
) ENGINE=InnoDB;
CREATE INDEX `saml_certificates_cert_data_idx` ON `saml_certificates` (`cert_data`);: Error 1170 (42000): BLOB/TEXT column 'cert_data' used in key specification without a key length

Reproducing the bug

Run hanko-migrate service with docker for MySQL version 8.4.0

Logs

2024/06/17 13:10:31 error executing migrations/20230915111552_create_saml_certs.up.fizz, sql: CREATE TABLE `saml_certificates` (
`id` char(36) NOT NULL,
PRIMARY KEY(`id`),
`cert_data` text NOT NULL,
`cert_key` text NOT NULL,
`encryption_key` VARCHAR (255) NOT NULL,
`created_at` DATETIME NOT NULL,
`updated_at` DATETIME NOT NULL
) ENGINE=InnoDB;
CREATE INDEX `saml_certificates_cert_data_idx` ON `saml_certificates` (`cert_data`);: Error 1170 (42000): BLOB/TEXT column 'cert_data' used in key specification without a key length

Configuration

database:
  user: root
  password: xxxxxxxxxx
  host: mysql
  port: 3306
  dialect: mysql
  database: hanko
smtp:
  host: "mailslurper"
  port: "2500"
passcode:
  email:
    from_address: no-reply@hanko.io
secrets:
  keys:
    - abcedfghijklmnopqrstuvwxyz
service:
  name: Hanko Authentication Service
webauthn:
  relying_party:
    origins:
      - "http://localhost:8888"
session:
  cookie:
    secure: false # is needed for safari, because safari does not store secure cookies on localhost
server:
  public:
    cors:
      allow_origins:
        - "http://localhost:8888"

Hanko Version

d400681

OS Hanko Backend

None

OS Version Hanko Backend

No response

OS

None

OS Version

No response

Browser Version

No response

Environment

Docker Compose

Additional Context

No response