Re: [Django] #28809: Changing SRID on geometry field doesn't create working migration

2022-02-18 Thread Django
#28809: Changing SRID on geometry field doesn't create working migration
+
 Reporter:  Jani Tiainen|Owner:  (none)
 Type:  Bug |   Status:  new
Component:  GIS |  Version:  dev
 Severity:  Normal  |   Resolution:
 Keywords:  migrations gis  | 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:  Sergey Fedoseev => (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/063.243bc250aa1ce7e5cac42278de7acc83%40djangoproject.com.


Re: [Django] #28809: Changing SRID on geometry field doesn't create working migration

2017-11-17 Thread Django
#28809: Changing SRID on geometry field doesn't create working migration
-+-
 Reporter:  Jani Tiainen |Owner:  Sergey
 |  Fedoseev
 Type:  Bug  |   Status:  assigned
Component:  GIS  |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  migrations gis   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Sergey Fedoseev):

 * status:  new => assigned
 * owner:  nobody => Sergey Fedoseev


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


Re: [Django] #28809: Changing SRID on geometry field doesn't create working migration

2017-11-17 Thread Django
#28809: Changing SRID on geometry field doesn't create working migration
+
 Reporter:  Jani Tiainen|Owner:  nobody
 Type:  Bug |   Status:  new
Component:  GIS |  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  migrations gis  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by Sergey Fedoseev):

 * cc: Sergey Fedoseev (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.c9c3152ac6f96c40404bd0eb9701ad35%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28809: Changing SRID on geometry field doesn't create working migration

2017-11-17 Thread Django
#28809: Changing SRID on geometry field doesn't create working migration
+
 Reporter:  Jani Tiainen|Owner:  nobody
 Type:  Bug |   Status:  new
Component:  GIS |  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  migrations gis  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by Jani Tiainen):

 True, SRID change migrations is not easy to do (might not even be possible
 sometimes due missing conversion parameters). But case should be handled
 much more gracefully than throwing out traceback.

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


Re: [Django] #28809: Changing SRID on geometry field doesn't create working migration

2017-11-17 Thread Django
#28809: Changing SRID on geometry field doesn't create working migration
+
 Reporter:  Jani Tiainen|Owner:  nobody
 Type:  Bug |   Status:  new
Component:  GIS |  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  migrations gis  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by Claude Paroz):

 * version:  1.11 => master
 * component:  Database layer (models, ORM) => GIS
 * stage:  Unreviewed => Accepted


Comment:

 Changing the SRID of a field is something that's hard to do when you have
 existing content. I don't think databases are doing anything clever when
 you do that (e.g. they don't convert the existing values, AFAIK). Probably
 the best strategy is to create a new column, move the values, converting
 them in the new SRID in the process, and delete the old column. The
 strategy might differ depending on the backend.

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


[Django] #28809: Changing SRID on geometry field doesn't create working migration

2017-11-16 Thread Django
#28809: Changing SRID on geometry field doesn't create working migration
-+-
   Reporter:  Jani   |  Owner:  nobody
  Tiainen|
   Type:  Bug| Status:  new
  Component:  Database   |Version:  1.11
  layer (models, ORM)|
   Severity:  Normal |   Keywords:  migrations gis
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 When changing SRID of geometry field:

 before:
 {{{#!python
 class AddressLog(models.Model):
 location = models.PointField(blank=True, null=True, srid=4326)
 }}}

 after:
 {{{#!python
 class AddressLog(models.Model):
 location = models.PointField(blank=True, null=True, srid=3067)
 }}}

 Migration:
 {{{#!python
 class Migration(migrations.Migration):

 dependencies = [
 ('myapp', '0002_auto_20171114_1021'),
 ]

 operations = [
 migrations.AlterField(
 model_name='addresslog',
 name='location',
 field=django.contrib.gis.db.models.fields.PointField(blank=True,
 null=True, srid=3067),
 ),
 ]
 }}}

 Traceback:
 {{{#!python
 (myapp) jtiai@jns42-l:~/projects/myproject (default) $ ./manage.py migrate
 Operations to perform:
   Apply all migrations: admin, auth, contenttypes, sessions, myapp
 Running migrations:
   Applying myapp.0003_auto_20171117_0641...Traceback (most recent call
 last):
   File "./manage.py", line 22, in 
 execute_from_command_line(sys.argv)
   File "/home/jtiai/.virtualenvs/myapp/lib/python3.6/site-
 packages/django/core/management/__init__.py", line 364, in
 execute_from_command_line
 utility.execute()
   File "/home/jtiai/.virtualenvs/myapp/lib/python3.6/site-
 packages/django/core/management/__init__.py", line 356, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/home/jtiai/.virtualenvs/myapp/lib/python3.6/site-
 packages/django/core/management/base.py", line 283, in run_from_argv
 self.execute(*args, **cmd_options)
   File "/home/jtiai/.virtualenvs/myapp/lib/python3.6/site-
 packages/django/core/management/base.py", line 330, in execute
 output = self.handle(*args, **options)
   File "/home/jtiai/.virtualenvs/myapp/lib/python3.6/site-
 packages/django/core/management/commands/migrate.py", line 204, in handle
 fake_initial=fake_initial,
   File "/home/jtiai/.virtualenvs/myapp/lib/python3.6/site-
 packages/django/db/migrations/executor.py", line 115, in migrate
 state = self._migrate_all_forwards(state, plan, full_plan, fake=fake,
 fake_initial=fake_initial)
   File "/home/jtiai/.virtualenvs/myapp/lib/python3.6/site-
 packages/django/db/migrations/executor.py", line 145, in
 _migrate_all_forwards
 state = self.apply_migration(state, migration, fake=fake,
 fake_initial=fake_initial)
   File "/home/jtiai/.virtualenvs/myapp/lib/python3.6/site-
 packages/django/db/migrations/executor.py", line 244, in apply_migration
 state = migration.apply(state, schema_editor)
   File "/home/jtiai/.virtualenvs/myapp/lib/python3.6/site-
 packages/django/db/migrations/migration.py", line 129, in apply
 operation.database_forwards(self.app_label, schema_editor, old_state,
 project_state)
   File "/home/jtiai/.virtualenvs/myapp/lib/python3.6/site-
 packages/django/db/migrations/operations/fields.py", line 216, in
 database_forwards
 schema_editor.alter_field(from_model, from_field, to_field)
   File "/home/jtiai/.virtualenvs/myapp/lib/python3.6/site-
 packages/django/db/backends/base/schema.py", line 494, in alter_field
 (old_field, new_field),
 ValueError: Cannot alter field myapp.AddressLog.location into
 myapp.AddressLog.location - they do not properly define db_type (are you
 using a badly-written custom field?)
 }}}


 Using Spatialite as backend engine.

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