Re: [Django] #26429: Name clash of merge migrations after squashing

2016-05-11 Thread Django
#26429: Name clash of merge migrations after squashing
-+-
 Reporter:  xgenadam |Owner:  rtpg
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  1.9
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  makemigrations   | Triage Stage:  Accepted
  merge clash|
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:"8f6a1a15516629b30e2fa2c48d5e682f7955868c" 8f6a1a15]:
 {{{
 #!CommitTicketReference repository=""
 revision="8f6a1a15516629b30e2fa2c48d5e682f7955868c"
 Fixed #26429 -- Added a timestamp to merge migration names.

 This reduces the possibility of a naming conflict, especially after
 squashing migrations.
 }}}

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


Re: [Django] #26429: Name clash of merge migrations after squashing

2016-05-08 Thread Django
#26429: Name clash of merge migrations after squashing
-+-
 Reporter:  xgenadam |Owner:  rtpg
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.9
 Severity:  Normal   |   Resolution:
 Keywords:  makemigrations   | Triage Stage:  Accepted
  merge clash|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * needs_better_patch:  1 => 0


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


Re: [Django] #26429: Name clash of merge migrations after squashing

2016-04-21 Thread Django
#26429: Name clash of merge migrations after squashing
-+-
 Reporter:  xgenadam |Owner:  rtpg
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.9
 Severity:  Normal   |   Resolution:
 Keywords:  makemigrations   | Triage Stage:  Accepted
  merge clash|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * needs_better_patch:  0 => 1


Comment:

 Tests need to be fixed on the PR.

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


Re: [Django] #26429: Name clash of merge migrations after squashing

2016-04-21 Thread Django
#26429: Name clash of merge migrations after squashing
-+-
 Reporter:  xgenadam |Owner:  rtpg
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.9
 Severity:  Normal   |   Resolution:
 Keywords:  makemigrations   | Triage Stage:  Accepted
  merge clash|
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/6485 PR]

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


Re: [Django] #26429: Name clash of merge migrations after squashing

2016-04-21 Thread Django
#26429: Name clash of merge migrations after squashing
-+-
 Reporter:  xgenadam |Owner:  rtpg
 Type:  Bug  |   Status:  assigned
Component:  Migrations   |  Version:  1.9
 Severity:  Normal   |   Resolution:
 Keywords:  makemigrations   | Triage Stage:  Accepted
  merge clash|
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by rtpg):

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


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


Re: [Django] #26429: Name clash of merge migrations after squashing

2016-04-19 Thread Django
#26429: Name clash of merge migrations after squashing
-+-
 Reporter:  xgenadam |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.9
 Severity:  Normal   |   Resolution:
 Keywords:  makemigrations   | Triage Stage:  Accepted
  merge clash|
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * stage:  Unreviewed => Accepted


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


Re: [Django] #26429: Name clash of merge migrations after squashing

2016-04-18 Thread Django
#26429: Name clash of merge migrations after squashing
-+-
 Reporter:  xgenadam |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.9
 Severity:  Normal   |   Resolution:
 Keywords:  makemigrations   | Triage Stage:
  merge clash|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Old description:

> After squashing migrations, further development can result in a merge
> migration with an identical name to a squashed migration.
> This is old merge is still stored in the django_migrations table and the
> new merge will not be applied.
>
> The workaround is to rename the merge to something unique. However the
> automatically generated names should not clash in the first place.

New description:



--

Comment (by izquierdo):

 The docs in
 
https://github.com/django/django/blob/2cd2d188516475ddf256e6267cd82c495fb5c430/django/db/migrations/autodetector.py#L1129
 say that names are not guaranteed to be unique and the timestamp is just a
 best effort to avoid conflicts. So I think rtpg's suggested fix works well
 for merge migrations, and a test to ensure names don't conflict is not
 necessary.

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


Re: [Django] #26429: Name clash of merge migrations after squashing

2016-04-18 Thread Django
#26429: Name clash of merge migrations after squashing
-+-
 Reporter:  xgenadam |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.9
 Severity:  Normal   |   Resolution:
 Keywords:  makemigrations   | Triage Stage:
  merge clash|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by rtpg):

 Did a bit more digging into this, I believe that the fix is changing
 
[(https://github.com/django/django/blob/master/django/core/management/commands/makemigrations.py#L286)],
 from :

 {{{
 new_migration = subclass("%04i_merge" % (biggest_number + 1), app_label)
 }}}

 to :

 {{{
 timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M")
 new_migration = subclass("%04i_merge_%s" % (biggest_number + 1,
 timestamp), app_label)
 }}}


 I'm not quite sure how to write tests for this, though. You could write
 some models, generate migrations, squash, generate new ones and then
 confirm that everything got run? But I feel like the current `squash`
 migration tests also cover this, and that there isn't really much in term
 of name conflict tests.

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


Re: [Django] #26429: Name clash of merge migrations after squashing

2016-04-18 Thread Django
#26429: Name clash of merge migrations after squashing
-+-
 Reporter:  xgenadam |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.9
 Severity:  Normal   |   Resolution:
 Keywords:  makemigrations   | Triage Stage:
  merge clash|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by rtpg):

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


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


Re: [Django] #26429: Name clash of merge migrations after squashing

2016-04-18 Thread Django
#26429: Name clash of merge migrations after squashing
-+-
 Reporter:  xgenadam |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  1.9
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  makemigrations   | Triage Stage:
  merge clash|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by rtpg):

 I just ran into a similar problem, going to detail what happened:

  - Over the course of development, do a merge migration. In our case, it
 was the 21st migration so got named `0021_merge.py`

  - Squash our migrations, deleting `0021_merge.py`

  - Continue development, and through sheer luck, our next 2st migration is
 also a merge commit. It gets named `0021_merge.py`

 - When running migrations, because the original migration was run, this
 new `0021_merge.py` commit is not run


 In my case, this was the dependencies of `0021_merge.py` (the new one):

 {{{
 dependencies = [
 ('document', '0020_auto_20160413_1834'),
 ('document', '0019_auto_20160414_1150'),
 ]
 }}}

 Because the merge commit wasn't run, some people only had the `0020`
 mainline migrations migrated, some people only had the `0019` branch
 migrations run, and some people (who hadn't run `migrate` in a while) had
 the following happen:

   - `migrate` detects `0021_merge.py` as the leaf node
   - there was record of the (old)  `0021_merge.py` migration
   - the system was like "oh, guess you're up to date!" and then doesn't
 run either branch of the merge commit

 Like the OP, I believe the simplest solution is to timestamp the merge
 migrations.

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


Re: [Django] #26429: Name clash of merge migrations after squashing

2016-04-04 Thread Django
#26429: Name clash of merge migrations after squashing
-+-
 Reporter:  xgenadam |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  1.9
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  makemigrations   | Triage Stage:
  merge clash|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

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


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


Re: [Django] #26429: Name clash of merge migrations after squashing

2016-03-31 Thread Django
#26429: Name clash of merge migrations after squashing
-+-
 Reporter:  xgenadam |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Migrations   |  Version:  1.9
 Severity:  Normal   |   Resolution:
 Keywords:  makemigrations   | Triage Stage:
  merge clash|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

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


Comment:

 For clarity, could you give the specific steps that led to the clash?

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


[Django] #26429: Name clash of merge migrations after squashing

2016-03-30 Thread Django
#26429: Name clash of merge migrations after squashing
+
 Reporter:  xgenadam|  Owner:  nobody
 Type:  Bug | Status:  new
Component:  Migrations  |Version:  1.9
 Severity:  Normal  |   Keywords:  makemigrations merge clash
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0   |  UI/UX:  0
+
 After squashing migrations, further development can result in a merge
 migration with an identical name to a squashed migration.
 This is old merge is still stored in the django_migrations table and the
 new merge will not be applied.

 The workaround is to rename the merge to something unique. However the
 automatically generated names should not clash in the first place.

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