zulip/corporate/migrations
Alex Vandiver 50c3dd88e6 models: Migrate ids of all non-Message-related tables to bigint.
Migrate all `ids` of anything which does not have a foreign key from
the Message or UserMessage table (and would thus require walking
those) to be `bigint`.  This is done by removing explicit
`BigAutoField`s, trading them for explicit `AutoField`s on the tables
to not be migrated, while updating `DEFAULT_AUTO_FIELD` to the new
default.

In general, the tables adjusted in this commit are small tables -- at
least compared to Messages and UserMessages.

Many-to-many tables without their own model class are adjusted by a
custom Operation, since they do not automatically pick up migrations
when `DEFAULT_AUTO_FIELD` changes[^1].

Note that this does multiple scans over tables to update foreign
keys[^2].  Large installs may wish to hand-optimize this using the
output of `./manage.py sqlmigrate` to join multiple `ALTER TABLE`
statements into one, to speed up the migration.  This is unfortunately
not possible to do generically, as constraint names may differ between
installations.

This leaves the following primary keys as non-`bigint`:
- `auth_group.id`
- `auth_group_permissions.id`
- `auth_permission.id`
- `django_content_type.id`
- `django_migrations.id`
- `otp_static_staticdevice.id`
- `otp_static_statictoken.id`
- `otp_totp_totpdevice.id`
- `two_factor_phonedevice.id`
- `zerver_archivedmessage.id`
- `zerver_client.id`
- `zerver_message.id`
- `zerver_realm.id`
- `zerver_recipient.id`
- `zerver_userprofile.id`

[^1]: https://code.djangoproject.com/ticket/32674
[^2]: https://code.djangoproject.com/ticket/24203
2024-06-05 11:48:27 -07:00
..
0001_initial.py
0002_customer_default_discount.py
0003_customerplan.py
0004_licenseledger.py
0005_customerplan_invoicing.py
0006_nullable_stripe_customer_id.py
0007_remove_deprecated_fields.py
0008_nullable_next_invoice_date.py
0009_customer_sponsorship_pending.py
0010_customerplan_exempt_from_from_license_number_check.py
0011_move_exempt_from_from_license_number_check_to_customer_model.py
0012_zulipsponsorshiprequest.py
0013_alter_zulipsponsorshiprequest_org_website.py
0014_customerplan_end_date.py
0015_event_paymentintent_session.py
0016_customer_add_remote_server_field.py
0017_rename_exempt_from_from_license_number_check_customer_exempt_from_license_number_check.py
0018_customer_cloud_xor_self_hosted.py
0019_zulipsponsorshiprequest_expected_total_users_and_more.py
0020_add_remote_realm_customers.py
0021_remove_session_payment_intent.py upgrade: Separate add card and purchase upgrade flow. 2023-11-20 12:04:56 -08:00
0022_session_is_manual_license_management_upgrade_session.py event_status: Return user back to same license management after session. 2023-11-21 11:44:04 -08:00
0023_zulipsponsorshiprequest_customer.py sponsorship: Use customer instead of realm to store sponsorship data. 2023-11-27 08:23:36 -08:00
0024_zulipsponsorshiprequest_fill_customer_data.py sponsorship: Use customer instead of realm to store sponsorship data. 2023-11-27 08:23:36 -08:00
0025_alter_zulipsponsorshiprequest_customer.py sponsorship: Use customer instead of realm to store sponsorship data. 2023-11-27 08:23:36 -08:00
0026_remove_zulipsponsorshiprequest_realm.py sponsorship: Use customer instead of realm to store sponsorship data. 2023-11-27 08:23:36 -08:00
0027_alter_zulipsponsorshiprequest_requested_by.py models: Make requested_by optional in sponsorship request model. 2023-11-29 19:04:32 -08:00
0028_zulipsponsorshiprequest_requested_plan.py sponsorship: Allow remote orgs to request a plan type. 2023-12-08 11:24:15 -08:00
0029_session_tier.py upgrade: Make it possible to upgrade to a provided tier. 2023-12-18 12:23:46 -08:00
0030_alter_zulipsponsorshiprequest_requested_plan.py corporate: Add a Basic plan. 2023-12-20 23:09:21 -08:00
0031_customer_flat_discount_and_more.py billing: Apply a flat discount for self hosted plans. 2023-12-20 23:09:21 -08:00
0032_customer_minimum_licenses.py corporate: Add minimum_licenses field to Customer model. 2024-01-04 18:42:07 -08:00
0033_customerplan_invoice_overdue_email_sent.py stripe: Add cron-based plan invoicing to remote realm billing system. 2024-01-14 15:47:55 -08:00
0034_customer_discount_required_tier.py corporate: Add required_plan_tier field to Customer model. 2024-01-15 03:10:04 -08:00
0035_update_legacy_plan_next_invoice_date.py stripe: Fix legacy plans not being invoiced. 2024-01-25 10:57:29 -08:00
0036_fix_customer_plans_scheduled_after_legacy_plan.py stripe: Fix invoicing for new plans scheduled to upgrade. 2024-01-25 10:57:29 -08:00
0037_customerplanoffer.py support: Add support to configure fixed_price plan. 2024-01-29 11:23:20 -08:00
0038_customerplanoffer_sent_invoice_id_invoice.py python: Reformat with Ruff formatter. 2024-02-29 17:07:16 -08:00
0039_backfill_end_date_for_fixed_price_plans.py python: Reformat with Ruff formatter. 2024-02-29 17:07:16 -08:00
0040_customerplan_reminder_to_review_plan_email_sent.py python: Reformat with Ruff formatter. 2024-02-29 17:07:16 -08:00
0041_fix_plans_on_free_trial_with_changes_in_schedule.py corporate: Fix invoicing of plans on free-trial with changed schedule. 2024-03-01 10:47:55 -08:00
0042_invoice_is_created_for_free_trial_upgrade_and_more.py stripe: Send invoice to customer at the start of free trial. 2024-04-11 21:57:33 -07:00
0043_remove_customer_default_discount_and_more.py support: Set discounted price instead percentage for customers. 2024-05-16 02:18:43 -07:00
0044_convert_ids_to_bigints.py models: Migrate ids of all non-Message-related tables to bigint. 2024-06-05 11:48:27 -07:00
__init__.py