adonisjs / v5-docs

📚 Source code and documentation for the official docs website.
https://v5-docs.adonisjs.com
88 stars 138 forks source link

mysql bigint #87

Open mybigman opened 3 years ago

mybigman commented 3 years ago

Our vendor databases use bigint as the primary key which is rather annoying.

Out of the box lucid (mysql driver) doesn't appear to support it.

After a few hours of trying to find a solution there is a setting that can be enabled to support this.

connections: {
    mysql: {
      client: 'mysql',
      connection: {
        host: Env.get('MYSQL_HOST'),
        port: Env.get('MYSQL_PORT'),
        user: Env.get('MYSQL_USER'),
        password: Env.get('MYSQL_PASSWORD', ''),
        database: Env.get('MYSQL_DB_NAME'),
        supportBigNumbers: true, // <---- here
      },
      migrations: {
        naturalSort: true,
      },
      healthCheck: false,
      debug: false,
    },
  }

Can you please add this to the documentation regarding supportBigNumbers: true as it would save a lot of headaches.

Thanks

thetutlage commented 3 years ago

Feel free to create a PR for the same :)