agendas: change Event id field to have a BigAutoField (#74008) #33
No reviewers
Labels
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: entrouvert/chrono#33
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "wip/74008-bigautofield"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
@ -0,0 +10,4 @@
ALTER TABLE "agendas_event_resources" ALTER COLUMN "event_id" TYPE bigint USING "event_id"::bigint;
ALTER TABLE "agendas_eventcancellationreport" ALTER COLUMN "event_id" TYPE bigint USING "event_id"::bigint;
ALTER TABLE "agendas_recurrenceexceptionsreport_events" ALTER COLUMN "event_id" TYPE bigint USING "event_id"::bigint;
"""
laisser django faire ne suffit pas:
Il drop la séquence (gloups), et ne traite que le model Event, pas les FK des autres models.
@ -0,0 +5,4 @@
sql_forwards_bigint = """
ALTER SEQUENCE "agendas_event_id_seq" as bigint MAXVALUE 9223372036854775807;
ALTER TABLE "agendas_event" ALTER COLUMN "id" TYPE bigint USING "id"::bigint;
ALTER TABLE "agendas_event" ALTER COLUMN "primary_event_id" TYPE bigint USING "primary_event_id"::bigint;
Un seul alter par table stp :)
766f4e650e
to95bdd66ffd
C'est bon pour moi côté SQL.
@ -2628,0 +2630,4 @@
cursor.execute("SELECT nextval('agendas_event_id_seq')")
row = cursor.fetchone()
if row[0] < 2**31:
cursor.execute("ALTER SEQUENCE agendas_event_id_seq RESTART WITH %s;" % 2**31)
pour tester au moins une fois, mais pas forcément sur toutes les FK, que ça passe sur un bigint
mais on peut virer ça maintenant que jenkins est passé au moins une fois
@ -2628,0 +2630,4 @@
cursor.execute("SELECT nextval('agendas_event_id_seq')")
row = cursor.fetchone()
if row[0] < 2**31:
cursor.execute("ALTER SEQUENCE agendas_event_id_seq RESTART WITH %s;" % 2**31)
pour tester au moins une fois, mais pas forcément sur toutes les FK, que ça passe sur un bigint
mais on peut virer ça maintenant que jenkins est passé au moins une fois