Developer builds custom Django command to alter Milvus schemas without data loss
A developer at a company using Milvus as its vector database needed to modify collection schemas in production without losing existing customer data. At the time, Milvus lacked a native ALTER command, with the only official workaround being a manual data migration to a new collection. To streamline this process, the developer wrapped the migration logic into a reusable Django management command that any team member could run safely. The command accepts a database name, collection name, new schema definition, and batch size, then creates a temporary collection, copies data in batches, drops the old collection, and renames the temporary one. Field removals and additions with default values are handled automatically, though updating existing field values is not currently supported.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in