Migrations hang when "default=" is set on a new field, while USING HASH.
See original GitHub issueIssue Description
What works.
First time table creation, and most other migrations work fine.
What does not work.
Migrations hang when default=
is set on a new field, while USING HASH
in the table.
message = models.TextField(default='') # Hangs migration.
message2 = models.TextField(null=True) # Works.
Issue Details
This issue is mentioned here: https://github.com/django/django/blob/7e3c9c3205e9646261cea5e5a7af7ec0e806690a/docs/ref/migration-operations.txt#L163
I believe, when the migration has to perform a full rewrite of the table, Django cannot understand crdb_internal_id_shard_16
(or how it fits into the model) when USING HASH
is specified.
Possible resolution
Is there a way to ignore or hide fields which CockroachDB generates automatically when using hash sharded index?
If we can get Django to simply ignore anything of crdb_internal_*
we could be okay.
Related: 78049 https://github.com/cockroachdb/django-cockroachdb/issues/264
Issue Analytics
- State:
- Created 6 months ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
default for serialized column in activerecord migration
When Rails serializes a hash to save in the db, all it does is convert it to YAML so that it can be...
Read more >Understanding migrations with Room | by Florina Muntenescu
An important part in the migration internals is played by an identity hash String that is used by Room to uniquely identify every...
Read more >sql: Use hash-sharded indexes by default · Issue #78049
Migrations hang when "default=" is set on a new field, while USING HASH. cockroachdb/django-cockroachdb#265. Closed. CRDB job hangs ...
Read more >Avoiding downtime in migrations - GitLab Docs
To rename a column without requiring downtime, we need two migrations: a regular migration and a post-deployment migration. Both these migrations can go...
Read more >Troubleshooting migration tasks in AWS Database Migration ...
To migrate secondary objects from your database, use the database's native tools if you are migrating to the same database engine as your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for this report! Could you share the way of reproducing the bug using only
cockroach sql
? And file an issue at https://github.com/cockroachdb/cockroach (or post here, and I can file it for you).Great, thanks. Closing as “not completed” since it’s not applicable to this repo.