Changes between Version 1 and Version 2 of Ticket #30511, comment 13


Ignore:
Timestamp:
Jun 24, 2019, 9:24:38 AM (5 years ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30511, comment 13

    v1 v2  
    11Michael, I haven't look into all the details but I'm confident you'll have to at least to change the following
    22
    3 1. https://github.com/django/django/blob/76b993a117b61c41584e95149a67d8a1e9f49dd1/django/db/backends/postgresql/base.py#L74-L75 (not that you want `bigint GENERATED ...` for `BigAutoField`).
     31. https://github.com/django/django/blob/76b993a117b61c41584e95149a67d8a1e9f49dd1/django/db/backends/postgresql/base.py#L74-L75 (note that you want `bigint GENERATED ...` for `BigAutoField`).
    442. You'll probably have to adjust introspection logic and tests to have both `serial` and `int GENERATED ...` map to `AutoField` and do the same for the `bigserial` and `BigAutoField`.
    553. You might have to adjust some migration code as I see [https://github.com/django/django/blob/1378d665a1c85897d951f2ca9618b848fdbba2e7/django/db/backends/postgresql/schema.py#L9-L10 it performs some sequence creation and deletion]. I guess you'll have to change the `create_sequence` usage in `_alter_column_type_sql` to use `ALTER COLUMN %(column) ADD GENERATED BY DEFAULT AS IDENTITY` on PostgreSQL 10+. Note at in this particular case I think we should keep dropping the sequence using `DROP SEQUENCE IF EXISTS ... CASCADE` even on PostgreSQL 10+ at least for one release after we drop support for PostgreSQL < 10 to avoid orphaning sequences during Django and PostgreSQL upgrades.
Back to Top