﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36082	db_table does not truncate properly for the non-default database	Scott		"When getting db_table for a model, table name is truncated to `connection.ops.max_name_length()`. See [https://github.com/django/django/blob/8bee7fa45cd7bfe70b68784314e994e2d193fd70/django/db/models/options.py#L235 here].

Since the name length is always calculated using `django.db.connection`, it always truncates the table name based on the max length of the default database. This causes issues when using multiple databases that have different engines. For example, if we were using a SQLite default database and a PostgreSQL secondary database, any table name longer than 63 characters will cause an error to be thrown.

This could be fixed by taking the minimum length when getting the table name. I can put in a PR."	Bug	closed	Database layer (models, ORM)	5.1	Normal	duplicate		Scott	Unreviewed	0	0	0	0	0	0
