Re: [Django] #27339: Adding an AutoField prompts for a default which creates a broken migration

2021-02-12 Thread Django
#27339: Adding an AutoField prompts for a default which creates a broken 
migration
--+
 Reporter:  Tim Graham|Owner:  (none)
 Type:  Cleanup/optimization  |   Status:  new
Component:  Migrations|  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Mariusz Felisiak):

 * owner:  za => (none)
 * status:  assigned => new


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.92a7066757247391107f2116b9f50d95%40djangoproject.com.


Re: [Django] #27339: Adding an AutoField prompts for a default which creates a broken migration

2019-08-21 Thread Django
#27339: Adding an AutoField prompts for a default which creates a broken 
migration
--+
 Reporter:  Tim Graham|Owner:  za
 Type:  Cleanup/optimization  |   Status:  assigned
Component:  Migrations|  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by za):

 * status:  new => assigned
 * owner:  nobody => za


Comment:

 I am facing the same issue, but on my case I don't have data on the
 existing table. I'll think how to solve this issue.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.6b547258a33fc216f761bfe870cb9eed%40djangoproject.com.


Re: [Django] #27339: Adding an AutoField prompts for a default which creates a broken migration

2017-11-09 Thread Django
#27339: Adding an AutoField prompts for a default which creates a broken 
migration
--+
 Reporter:  Tim Graham|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Migrations|  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Akshay Raj Gollahalli):

 In Django 2.0b1 when trying to migrate without the default value, the CLI
 asks to enter a default value.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.67296d778b76257337dd71b2285fc0c0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #27339: Adding an AutoField prompts for a default which creates a broken migration

2016-10-12 Thread Django
#27339: Adding an AutoField prompts for a default which creates a broken 
migration
+
   Reporter:  Tim Graham|  Owner:  nobody
   Type:  Cleanup/optimization  | Status:  new
  Component:  Migrations|Version:  master
   Severity:  Normal|   Keywords:
   Triage Stage:  Accepted  |  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
  UI/UX:  0 |
+
 Change:
 {{{
 class Foo(models.Model):
 id = models.CharField(max_length=20, primary_key=True)
 }}}
 to:
 {{{
 class Foo(models.Model):
 character_id = models.AutoField(primary_key=True)
 }}}
 The created migration has these operations:
 {{{
 migrations.RemoveField(
 model_name='foo',
 name='id',
 ),
 migrations.AddField(
 model_name='foo',
 name='character_id',
 field=models.AutoField(default=0, primary_key=True, serialize=False),
 preserve_default=False,
 ),
 }}}
 (entering 0 at the default prompt). Running the migration on PostgreSQL
 gives: `ProgrammingError: multiple default values specified for column
 "character_id" of table "t27267_foo"`. I'm not sure if this can be made to
 work sensibly. Removing the default from the migration operation works,
 but if there's an existing data, the `character_id` field must be
 populated somehow (perhaps a `RunPython` could be done in the same
 migration?). #27338 is related. This was discovered while investigating
 #27267.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.a159e3165649a04bcbe6411cf2512ecb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.