Re: [Django] #24535: Make "manage.py migrate" atomic, i.e. rolling back any migrations on failure

2020-01-20 Thread Django
#24535: Make "manage.py migrate" atomic, i.e. rolling back any migrations on
failure
---+--
 Reporter:  Daniel Hahler  |Owner:  nobody
 Type:  New feature|   Status:  closed
Component:  Migrations |  Version:  1.7
 Severity:  Normal |   Resolution:  wontfix
 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 Simon Charette):

 Even if this limitation is now lifted it would still be impossible in the
 case of non-atomic migrations/operations
 [https://docs.djangoproject.com/en/3.0/howto/writing-migrations/#non-
 atomic-migrations either explicit] or implicit because the database
 backend doesn't support transactional DDL. The framework also defers quite
 of bit of operations (search for usage of `deferred_sql` in the code base)
 and some are
 [https://docs.djangoproject.com/en/3.0/ref/contrib/postgres/operations
 /#index-concurrent-operations simply unsupported in a transaction].

 If you really want to give this a go you can easily override the `migrate`
 command by wrapping it's `handle` in an `atomic` block for the specified
 `--database` but you have to keep in mind that'll likely break under
 certain circumstances and it has the potential to take your side database
 down if the transaction is held because of a long running operation.

 If you really want to roll back on failure you can easily emulate such
 thing by keeping track of where you are before performing migrating and
 migrating to the previous state if any exception is raised. This is
 something you can easily achieve with the commands the migration framework
 currently exposes.

-- 
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/065.1dbf0920fc85bbe7cbb3bfce69d5c784%40djangoproject.com.


Re: [Django] #24535: Make "manage.py migrate" atomic, i.e. rolling back any migrations on failure

2020-01-20 Thread Django
#24535: Make "manage.py migrate" atomic, i.e. rolling back any migrations on
failure
---+--
 Reporter:  Daniel Hahler  |Owner:  nobody
 Type:  New feature|   Status:  closed
Component:  Migrations |  Version:  1.7
 Severity:  Normal |   Resolution:  wontfix
 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 Andrew Badr):

 Replying to [comment:1 Tim Graham]:
 > I'm not sure it's feasible. For example, in PostgreSQL you cannot update
 a table (data migration) and then alter the table schema in one
 transaction.

 That's not true (anymore?). I just tried it in a local shell and it
 worked. Maybe there are certain sequences of alter/updates that don't
 work. Haven't been able to find docs spelling it out.

-- 
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/065.beb4d4a7e89dcd7d47e893078ac6cc44%40djangoproject.com.


Re: [Django] #24535: Make "manage.py migrate" atomic, i.e. rolling back any migrations on failure

2015-03-26 Thread Django
#24535: Make "manage.py migrate" atomic, i.e. rolling back any migrations on
failure
-+--
 Reporter:  blueyed  |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:  wontfix
 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 timgraham):

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


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


Re: [Django] #24535: Make "manage.py migrate" atomic, i.e. rolling back any migrations on failure

2015-03-25 Thread Django
#24535: Make "manage.py migrate" atomic, i.e. rolling back any migrations on
failure
-+--
 Reporter:  blueyed  |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Migrations   |  Version:  1.7
 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 timgraham):

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


Comment:

 I'm not sure it's feasible. For example, in PostgreSQL you cannot update a
 table (data migration) and then alter the table schema in one transaction.

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


[Django] #24535: Make "manage.py migrate" atomic, i.e. rolling back any migrations on failure

2015-03-24 Thread Django
#24535: Make "manage.py migrate" atomic, i.e. rolling back any migrations on
failure
-+
 Reporter:  blueyed  |  Owner:  nobody
 Type:  New feature  | Status:  new
Component:  Migrations   |Version:  1.7
 Severity:  Normal   |   Keywords:
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0|  UI/UX:  0
-+
 While each migration by itself appears to be atomic, the whole "manage.py
 migrate" process isn't.

 I think that it would be useful to wrap it into a transaction altogether.

 This would rollback all successful migrations in case a later one fails,
 and would help with deployment, where you want to have all or none of the
 migrations being applied.

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