zulip/tools
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
..
ci Remove support for Ubuntu 20.04 and Debian 11. 2024-04-01 13:27:39 -07:00
documentation_crawler tools: Update some exclusion rules. 2024-05-09 12:40:21 -07:00
droplets droplet: Rebuild droplet image with 22.04. 2024-05-30 11:51:44 -07:00
i18n i18n-tools: Write a newline when unescaping json data contents. 2024-06-04 08:20:24 -07:00
lib left_sidebar: Rename "more topics" to "all topics". 2024-06-04 10:18:54 -07:00
linter_lib message_helper: Be more explicit about converting subject to topic. 2024-05-29 16:45:36 -07:00
node_lib
oneclickapps oneclickapps: Upgrade DigitalOcean 1-Click App to Ubuntu 22.04. 2024-03-25 13:19:09 -07:00
screenshots tools: Replace `realm_uri` with `realm_url`. 2024-06-03 10:07:10 -07:00
setup hello: Redesign landing page. 2024-06-02 21:45:37 -07:00
test-install Remove support for Ubuntu 20.04 and Debian 11. 2024-04-01 13:27:39 -07:00
tests mypy: Enable new error explicit-override. 2023-10-12 12:28:41 -07:00
zulip-export
README.md
__init__.py
backport-pull-request backport: Fix the commit-ids that are used. 2024-05-06 14:47:22 -07:00
build-docs
build-release-tarball emails: Inline CSS in emails in build_email. 2023-04-05 12:22:29 -07:00
cache-zulip-git-version
check-capitalization python: Mark regexes as raw strings. 2024-04-26 12:30:31 -07:00
check-frontend-i18n tools: Fix broken link in check-frontend-i18n. 2024-04-03 13:13:16 -07:00
check-issue-labels ruff: Fix PERF401 Use a list comprehension to create a transformed list. 2023-08-07 17:23:55 -07:00
check-openapi check-openapi: Modernize yargs usage. 2024-04-08 16:50:56 -07:00
check-provision
check-schemas openapi: Add missing user property to deprecated user settings events. 2023-10-23 09:07:07 -07:00
check-templates check-templates: Check Django/Handlebars templates differently. 2023-10-11 17:53:07 -07:00
check-thirdparty
clean-branches
commit-message-lint
commit-msg commit-msg: Don’t change the current directory for non-Vagrant. 2023-05-23 12:24:44 -07:00
conf.ini-template
coveragerc coverage: Clean up coverage configuration. 2023-05-31 13:53:04 -07:00
deploy-branch
diagnose
documentation.vnufilter docs: Update VNU filter to ignore warnings about sphinx-design. 2024-03-22 16:54:57 -07:00
duplicate_commits.json
fetch-contributor-data team: Add more repositories and rename tabs. 2024-03-01 14:57:46 -08:00
fetch-pull-request
fetch-rebase-pull-request
find-unused-css
lint lint: Quiet the Ruff formatter. 2024-04-03 15:34:02 -07:00
pre-commit
provision Remove support for Ubuntu 20.04 and Debian 11. 2024-04-01 13:27:39 -07:00
push-to-pull-request push-to-pull-request: Accept intermixed options and arguments again. 2024-02-01 17:08:44 -08:00
rebuild-dev-database
rebuild-test-database
release release: Fix changelog output. 2024-03-19 16:05:53 -07:00
release-tarball-exclude.txt puppet: Rename puppet/zulip_ops to puppet/kandra. 2024-02-06 17:56:27 -08:00
renumber-migrations renumber-migrations: Skip migration 0501. 2024-04-10 11:15:00 -07:00
reset-to-pull-request
review
run-codespell dependencies: Switch to pnpm. 2023-03-20 15:48:29 -07:00
run-dev partial: Replace returns plugin with an annotation. 2024-04-29 17:14:41 -07:00
run-mypy
run-tsc
semgrep-py.yml models: Migrate ids of all non-Message-related tables to bigint. 2024-06-05 11:48:27 -07:00
setup-git-repo
show-profile-results
stop-run-dev
tail-ses
test-all
test-api do_deactivate_realm: Add deactivation_reason kwarg. 2024-05-19 23:07:28 -07:00
test-backend data_import: Remove gitter data import tool. 2024-05-02 13:25:25 -07:00
test-documentation tools: Fix test-documentation merge check errors. 2024-03-19 15:01:33 -07:00
test-help-documentation
test-js-with-node settings_preferences: Convert module to TypeScript. 2024-06-04 08:50:07 -07:00
test-js-with-puppeteer puppeteer: Allow reruns in interactive mode when tests succeed. 2023-09-13 12:46:22 -07:00
test-locked-requirements
test-migrations
test-queue-worker-reload models: Rename zerver/models.py to zerver/models/__init__.py. 2023-12-16 22:08:44 -08:00
test-run-dev run-dev: Drop .py from script name. 2023-03-03 18:02:37 -08:00
test-tools
total-contributions docs: Fix grammar errors found by mwic. 2023-10-09 13:24:09 -07:00
update-locked-requirements
update-prod-static update-prod-static: Only run generate_landing_page_images if necessary. 2023-10-05 09:04:33 -07:00
update-zuliprc-api-field
upload-release
webpack katex: Replace subprocess call with minimal external service. 2024-03-15 15:34:12 -07:00
zanitizer
zanitizer_config.pm.sample

README.md

This directory contains scripts that are used in building, managing, testing, and other forms of work in a Zulip development environment. Note that tools that are also useful in production belong in scripts/ or should be Django management commands.

For more details, see https://zulip.readthedocs.io/en/latest/overview/directory-structure.html.