Changes between Version 1 and Version 2 of Ticket #32653, comment 5
- Timestamp:
- Apr 15, 2021, 3:54:53 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32653, comment 5
v1 v2 1 @Mariusz the issue is see with your solution is that it will work from my current case Postgres as `default`, Oracle as `old`. Where Postgres wont change the `db_table` as long as its under 63 chars??? But if we have the inverse, Oracle as `default` and Postgres as `new`; it will break Postgres since the `db_table` would be something like `backends_verylongmodelname1234` and Postgres would want the whole string `backends_verylongmodelnamezzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz`. Th e solution @Simon suggested would work on both cases.1 @Mariusz the issue is see with your solution is that it will work from my current case Postgres as `default`, Oracle as `old`. Where Postgres wont change the `db_table` as long as its under 63 chars??? But if we have the inverse, Oracle as `default` and Postgres as `new`; it will break Postgres since the `db_table` would be something like `backends_verylongmodelname1234` and Postgres would want the whole string `backends_verylongmodelnamezzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz`. This is because the `default` connection is used to setup the table names at startup https://github.com/django/django/blob/stable/3.2.x/django/db/models/options.py#L207 . The solution @Simon suggested would work on both cases.