Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-28 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
-+-
 Reporter:  murfi|Owner:  coldmind
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  1.8
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"f65d4db8a805e5184898563542fcb5d459273582" f65d4db]:
 {{{
 #!CommitTicketReference repository=""
 revision="f65d4db8a805e5184898563542fcb5d459273582"
 [1.8.x] Fixed #24817 -- Prevented loss of null info in MySQL field
 renaming.

 Backport of 80ad5472ce4b6ba6e94227422d0727371e97cdf0 from master
 }}}

--
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/063.c3d5070b259ebe49bc68b4fe1c397c26%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-28 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
-+-
 Reporter:  murfi|Owner:  coldmind
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  1.8
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"927d90ee1ee4aa630a5a879b5fd75aa03a3341f7" 927d90ee]:
 {{{
 #!CommitTicketReference repository=""
 revision="927d90ee1ee4aa630a5a879b5fd75aa03a3341f7"
 [1.7.x] Fixed #24817 -- Prevented loss of null info in MySQL field
 renaming.

 Backport of 80ad5472ce4b6ba6e94227422d0727371e97cdf0 from master
 }}}

--
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/063.51b4d288a0e506ebbfb6caaf79b47c92%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-28 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
-+-
 Reporter:  murfi|Owner:  coldmind
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  1.8
 Severity:  Release blocker  |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"80ad5472ce4b6ba6e94227422d0727371e97cdf0" 80ad547]:
 {{{
 #!CommitTicketReference repository=""
 revision="80ad5472ce4b6ba6e94227422d0727371e97cdf0"
 Fixed #24817 -- Prevented loss of null info in MySQL field renaming.
 }}}

--
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/063.8e601bb94cf9606ddb74c8c9d00638a5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-28 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
-+-
 Reporter:  murfi|Owner:  coldmind
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.8
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by claudep):

 Yes, sure! Thanks Andriy.

--
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/063.1f8c0c1fba82a3fdfc42d7ab715ac715%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-27 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
-+-
 Reporter:  murfi|Owner:  coldmind
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.8
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * stage:  Accepted => Ready for checkin


Comment:

 Claude, look good to you?

--
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/063.fd17efbb14ce5d21877143c29f1035c3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-26 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
-+
 Reporter:  murfi|Owner:  coldmind
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.8
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by coldmind):

 PR against master - https://github.com/django/django/pull/4715

--
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/063.cff00f4b6166f704c78638594508e86c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-26 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
-+
 Reporter:  murfi|Owner:  coldmind
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.8
 Severity:  Release blocker  |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by coldmind):

 * owner:  nobody => coldmind
 * status:  new => assigned
 * has_patch:  0 => 1


Comment:

 https://github.com/django/django/pull/4714

--
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/063.a3fb9c2c0b2db3e5a0a1c13bf9d9a22b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-26 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
-+
 Reporter:  murfi|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.8
 Severity:  Release blocker  |   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 coldmind):

 * cc: me@… (added)


Comment:

 I just attached a patch with tests which reproduces the issue.
 I'm also working on fixing 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 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/063.018ae85a5183c9a1d7d10b5aa5837a03%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-26 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
-+
 Reporter:  murfi|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.8
 Severity:  Release blocker  |   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 coldmind):

 * Attachment "ticket_24817.patch" added.

 Test to reproduce the 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 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/063.47f25e5dca52b31bb12f8f0de5f9d120%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-19 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
-+
 Reporter:  murfi|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.8
 Severity:  Release blocker  |   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 claudep):

 We've missed the rename use case while fixing #24595 :-(

--
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/063.2ab3897db1db9820c747c79217300240%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-19 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
-+
 Reporter:  murfi|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.8
 Severity:  Release blocker  |   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 alasdairnicol):

 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted


Comment:

 Apologies for incorrectly closing as a duplicate before. I can reproduce
 in Django 1.7.8, 1.8.1 and master.

--
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/063.e55214000dc40198f057547b0aaef048%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-19 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
+--
 Reporter:  murfi   |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  Migrations  |  Version:  1.8
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--

Comment (by murfi):

 True the comment in the end related to changing field type was invalid and
 fixed in #24595. The example case is still reproducible with
 Django==1.8.1.

--
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/063.955da505a9e61ea4a628f6b7dd878e60%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-19 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
+--
 Reporter:  murfi   |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  Migrations  |  Version:  1.8
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--
Changes (by murfi):

 * status:  closed => new
 * resolution:  duplicate =>


Old description:

> Steps to reproduce:
>
> 1. Create a simple model:
> {{{
> class TestModel(models.Model):
> value_a = models.IntegerField(null=False)
> }}}
> 2. '''./manage.py makemigrations'''
> 3. '''./manage.py migrate'''
> 4. So far so good:
> {{{
> mysql> describe testy_testmodel;
> +-+-+--+-+-++
> | Field   | Type| Null | Key | Default | Extra  |
> +-+-+--+-+-++
> | id  | int(11) | NO   | PRI | NULL| auto_increment |
> | value_a | int(11) | NO   | | NULL||
> +-+-+--+-+-++
> 2 rows in set (0.00 sec)
> }}}
> 5. Change model field name '''value_a''' -> '''value_b''':
> {{{
> class TestModel(models.model):
> value_b = models.IntegerField(null=False)
> }}}
> 6. '''./manage.py makemigrations'''
> 7. '''./manage.py migrate'''
> 8. '''NOT NULL''' for '''value_b''' has been lost:
> {{{
> mysql> describe testy_testmodel;
> +-+-+--+-+-++
> | Field   | Type| Null | Key | Default | Extra  |
> +-+-+--+-+-++
> | id  | int(11) | NO   | PRI | NULL| auto_increment |
> | value_b | int(11) | YES  | | NULL||
> +-+-+--+-+-++
> 2 rows in set (0.00 sec)
> }}}
>
> The '''ALTER-'''statement django produces is
> {{{
> ALTER TABLE `testy_testmodel` CHANGE `value_a` `value_b` integer;
> }}}
> ...and it should contain the '''NOT NULL''', but it doesn't.
>
> This affects other '''ALTER TABLE'''-statements too, e.g. if changing
> field type from''' IntegerField''' to '''BigIntergerField'''. The bug is
> present in 1.7 as well.

New description:

 Steps to reproduce:

 1. Create a simple model:
 {{{
 class TestModel(models.Model):
 value_a = models.IntegerField(null=False)
 }}}
 2. '''./manage.py makemigrations'''
 3. '''./manage.py migrate'''
 4. So far so good:
 {{{
 mysql> describe testy_testmodel;
 +-+-+--+-+-++
 | Field   | Type| Null | Key | Default | Extra  |
 +-+-+--+-+-++
 | id  | int(11) | NO   | PRI | NULL| auto_increment |
 | value_a | int(11) | NO   | | NULL||
 +-+-+--+-+-++
 2 rows in set (0.00 sec)
 }}}
 5. Change model field name '''value_a''' -> '''value_b''':
 {{{
 class TestModel(models.model):
 value_b = models.IntegerField(null=False)
 }}}
 6. '''./manage.py makemigrations'''
 7. '''./manage.py migrate'''
 8. '''NOT NULL''' for '''value_b''' has been lost:
 {{{
 mysql> describe testy_testmodel;
 +-+-+--+-+-++
 | Field   | Type| Null | Key | Default | Extra  |
 +-+-+--+-+-++
 | id  | int(11) | NO   | PRI | NULL| auto_increment |
 | value_b | int(11) | YES  | | NULL||
 +-+-+--+-+-++
 2 rows in set (0.00 sec)
 }}}

 The '''ALTER-'''statement django produces is
 {{{
 ALTER TABLE `testy_testmodel` CHANGE `value_a` `value_b` integer;
 }}}
 ...and it should contain the '''NOT NULL''', but it doesn't.


 '''Edit''': Similar bug when changing field type was fixed in #24595. The
 bug is still present in 1.8.1 when renaming a field.

--

--
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/063.04d1c695133869e3eb69eb8a72e8192a%40djangoproject.com.
For more options, visit https://groups.google

Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-19 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
+--
 Reporter:  murfi   |Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Migrations  |  Version:  1.8
 Severity:  Normal  |   Resolution:  duplicate
 Keywords:  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--
Changes (by alasdairnicol):

 * cc: alasdair@… (added)


--
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/063.dbda3a57b1e6c3a5992bbb540ec57641%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-19 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
+--
 Reporter:  murfi   |Owner:  nobody
 Type:  Bug |   Status:  closed
Component:  Migrations  |  Version:  1.8
 Severity:  Normal  |   Resolution:  duplicate
 Keywords:  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--
Changes (by alasdairnicol):

 * status:  new => closed
 * resolution:   => duplicate


Comment:

 This looks like a duplicate of #24595, which is fixed in 1.7.8 and 1.8.1.

--
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/063.df06c58c075fe5136f10f86131ceab71%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-19 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
+--
 Reporter:  murfi   |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  Migrations  |  Version:  1.8
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--
Changes (by murfi):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Old description:

> Steps to reproduce:
>
> 1. Create a simple model:
> {{{
> class TestModel(models.Model):
> value_a = models.IntegerField(null=False)
> }}}
> 2. '''./manage.py makemigrations'''
> 3. '''./manage.py migrate'''
> 4. So far so good:
> {{{
> mysql> describe testy_testmodel;
> +-+-+--+-+-++
> | Field   | Type| Null | Key | Default | Extra  |
> +-+-+--+-+-++
> | id  | int(11) | NO   | PRI | NULL| auto_increment |
> | value_a | int(11) | NO   | | NULL||
> +-+-+--+-+-++
> 2 rows in set (0.00 sec)
> }}}
> 5. Change model field name '''value_a''' -> '''value_b''':
> {{{
> class TestModel(models.model):
> value_b = models.IntegerField(null=False)
> }}}
> 6. '''./manage.py makemigrations'''
> 7. '''./manage.py migrate'''
> 8. '''NOT NULL''' for '''value_b''' has bee lost:
> {{{
> mysql> describe testy_testmodel;
> +-+-+--+-+-++
> | Field   | Type| Null | Key | Default | Extra  |
> +-+-+--+-+-++
> | id  | int(11) | NO   | PRI | NULL| auto_increment |
> | value_b | int(11) | YES  | | NULL||
> +-+-+--+-+-++
> 2 rows in set (0.00 sec)
> }}}
>
> The '''ALTER-'''statement django produces is
> {{{
> ALTER TABLE `testy_testmodel` CHANGE `value_a` `value_b` integer;
> }}}
> ...and it should contain the '''NOT NULL''', but it doesn't.
>
> This affects other '''ALTER TABLE'''-statements too, e.g. if changing
> field type from''' IntegerField''' to '''BigIntergerField'''. The bug is
> present in 1.7 as well.

New description:

 Steps to reproduce:

 1. Create a simple model:
 {{{
 class TestModel(models.Model):
 value_a = models.IntegerField(null=False)
 }}}
 2. '''./manage.py makemigrations'''
 3. '''./manage.py migrate'''
 4. So far so good:
 {{{
 mysql> describe testy_testmodel;
 +-+-+--+-+-++
 | Field   | Type| Null | Key | Default | Extra  |
 +-+-+--+-+-++
 | id  | int(11) | NO   | PRI | NULL| auto_increment |
 | value_a | int(11) | NO   | | NULL||
 +-+-+--+-+-++
 2 rows in set (0.00 sec)
 }}}
 5. Change model field name '''value_a''' -> '''value_b''':
 {{{
 class TestModel(models.model):
 value_b = models.IntegerField(null=False)
 }}}
 6. '''./manage.py makemigrations'''
 7. '''./manage.py migrate'''
 8. '''NOT NULL''' for '''value_b''' has been lost:
 {{{
 mysql> describe testy_testmodel;
 +-+-+--+-+-++
 | Field   | Type| Null | Key | Default | Extra  |
 +-+-+--+-+-++
 | id  | int(11) | NO   | PRI | NULL| auto_increment |
 | value_b | int(11) | YES  | | NULL||
 +-+-+--+-+-++
 2 rows in set (0.00 sec)
 }}}

 The '''ALTER-'''statement django produces is
 {{{
 ALTER TABLE `testy_testmodel` CHANGE `value_a` `value_b` integer;
 }}}
 ...and it should contain the '''NOT NULL''', but it doesn't.

 This affects other '''ALTER TABLE'''-statements too, e.g. if changing
 field type from''' IntegerField''' to '''BigIntergerField'''. The bug is
 present in 1.7 as well.

--

--
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/063.2e2baa7c806474d2bdfe638a1d88aaf1%40djang

[Django] #24817: Renaming a model field that has null=False makes it nullable in MySQL

2015-05-19 Thread Django
#24817: Renaming a model field that has null=False makes it nullable in MySQL
+
 Reporter:  murfi   |  Owner:  nobody
 Type:  Bug | Status:  new
Component:  Migrations  |Version:  1.8
 Severity:  Normal  |   Keywords:
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0   |  UI/UX:  0
+
 Steps to reproduce:

 1. Create a simple model:
 {{{
 class TestModel(models.Model):
 value_a = models.IntegerField(null=False)
 }}}
 2. '''./manage.py makemigrations'''
 3. '''./manage.py migrate'''
 4. So far so good:
 {{{
 mysql> describe testy_testmodel;
 +-+-+--+-+-++
 | Field   | Type| Null | Key | Default | Extra  |
 +-+-+--+-+-++
 | id  | int(11) | NO   | PRI | NULL| auto_increment |
 | value_a | int(11) | NO   | | NULL||
 +-+-+--+-+-++
 2 rows in set (0.00 sec)
 }}}
 5. Change model field name '''value_a''' -> '''value_b''':
 {{{
 class TestModel(models.model):
 value_b = models.IntegerField(null=False)
 }}}
 6. '''./manage.py makemigrations'''
 7. '''./manage.py migrate'''
 8. '''NOT NULL''' for '''value_b''' has bee lost:
 {{{
 mysql> describe testy_testmodel;
 +-+-+--+-+-++
 | Field   | Type| Null | Key | Default | Extra  |
 +-+-+--+-+-++
 | id  | int(11) | NO   | PRI | NULL| auto_increment |
 | value_b | int(11) | YES  | | NULL||
 +-+-+--+-+-++
 2 rows in set (0.00 sec)
 }}}

 The '''ALTER-'''statement django produces is
 {{{
 ALTER TABLE `testy_testmodel` CHANGE `value_a` `value_b` integer;
 }}}
 ...and it should contain the '''NOT NULL''', but it doesn't.

 This affects other '''ALTER TABLE'''-statements too, e.g. if changing
 field type from''' IntegerField''' to '''BigIntergerField'''. The bug is
 present in 1.7 as well.

--
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/048.5474c41df1e75cfe6f2e16642e68ee4a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.