D
D
Dennis2016-06-14 13:02:42
PostgreSQL
Dennis, 2016-06-14 13:02:42

GeoDjango - throws an error when using the migrate command?

Good afternoon!
GeoDjango project, DB PostgreSQL 9.5, PostGIS 2.2.2
When migrating data, it gives an error:
Applying fl_app.0003_auto_20160613_1615...Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "C:\commercial_projects\fl-g-maps\lib\site-packages \django\core\management__init.py", line 354, in execute_from_command_line utility.execute() File "C:\commercial_projects\fl-g-maps\lib\site-packages\django\core\management__init.py", line 346 , in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\commercial_projects\fl-g-maps\lib\site-packages\django\core\management\base.py", line 394, in run_from_argv self.execute(*args, cmd_options) File "C:\commercial_projects\fl-g-maps\lib\site-packages\django\core\management\base.py", line 445, in execute output = self.handle (*args, options) File "C:\commercial_projects\fl-g-maps\lib\site-packages\django\core\management\commands\migrate.py", line 222, in handle executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial) File "C:\commercial_projects\fl-g-maps\lib\site-packages\django\db\migrations\executor.py", line 110, in migrate self.apply_migration(states[migration], migration, fake=fake, fake_initial =fake_initial) File "C:\commercial_projects\fl-g-maps\lib\site-packages\django\db\migrations\executor.py", line 148, in apply_migration state = migration.apply(state, schema_editor) File " C:\commercial_projects\fl-g-maps\lib\site-packages\django\db\migrations\migration.py", line 115, in apply operation.database_forwards(self.app_label, schema_editor, old_state, project_state) File "C :\commercial_projects\fl-g-maps\lib\site-packages\django\db\migrations\operations\fields.py", line 201, in database_forwards schema_editor.alter_field(from_model, from_field, to_field) File "C:\commercial_projects\ fl-g-maps\lib\site-packages\django\db\backends\base\schema.py", line 484, in alter_field old_db_params, new_db_params, strict) File "C:\commercial_projects\fl-g-maps\lib \site-packages\django\db\backends\base\schema.py", line 636, in _alter_field params, File "C:\commercial_projects\fl-g-maps\lib\site-packages\django\db\backends\ base\schema.py", line 111, in execute cursor.execute(sql, params) File "C:\commercial_projects\fl-g-maps\lib\site-packages\django\db\backends\utils.py", line 79, in execute return super(CursorDebugWrapper, self).execute(sql, params) File "C:\commercial_projects\fl-g-maps\lib\site-packages\django\db\backends\utils.py", line 64, in execute return self.cursor.execute(sql, params) File "C:\commercial_projects\fl -g-maps\lib\site-packages\django\db\utils.py", line 98, in exit six.reraise(dj_exc_type, dj_exc_value, traceback) File "C:\commercial_projects\fl-g-maps\lib\ site-packages\django\db\backends\utils.py", line 64, in execute return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: ╨S╨i╨Ш╨С╨Ъ╨ R: ╤B╤V╨╛╨╗╨▒╨╡╤Ж "coords" ╨╜╨╡╨╗╤M╨╖╤P ╨░╨▓╤В╨╛╨╝╨░╤В╨╕╤З ╡╤B╨║╨╕ ╨┐╤A╨╕╨▓╨╡╤B╤C╨╕ ╨║ ╤B╨╕╨┐╤G geometry HINT: ╨T╨╛╨╖╨╝╨╛╨ "USING coords::geometry(Point,4326)".\commercial_projects\fl-g-maps\lib\site-packages\django\db\utils.py", line 98, in exit six.reraise(dj_exc_type, dj_exc_value, traceback) File "C:\commercial_projects\fl-g- maps\lib\site-packages\django\db\backends\utils.py", line 64, in execute return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: ╨S╨and╨SH╨ С╨Ъ╨Р: ╤Б╤В╨╛╨╗╨▒╨╡╤Ж "coords" ╨╜╨╡╨╗╤М╨╖╤П ╨░╨▓╤В╨╛╨╝╨░╤В╨ G "USING coords(int::geometry 4326)".\commercial_projects\fl-g-maps\lib\site-packages\django\db\utils.py", line 98, in exit six.reraise(dj_exc_type, dj_exc_value, traceback) File "C:\commercial_projects\fl-g- maps\lib\site-packages\django\db\backends\utils.py", line 64, in execute return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: ╨S╨and╨SH╨ С╨Ъ╨Р: ╤Б╤В╨╛╨╗╨▒╨╡╤Ж "coords" ╨╜╨╡╨╗╤М╨╖╤П ╨░╨▓╤В╨╛╨╝╨░╤В╨ G "USING coords(int::geometry 4326)".params) django.db.utils.ProgrammingError: ╨Y╨i╨Ш╨С╨Ъ╨R: ╤B╤V╨╛╨╗╨▒╨╡╤Ж "coords" ╨╜╨╡╨╗╤M╨╖ C G ╨╖╨░╤B╤M "USING coords::geometry(Point,4326)".params) django.db.utils.ProgrammingError: ╨Y╨i╨Ш╨С╨Ъ╨R: ╤B╤V╨╛╨╗╨▒╨╡╤Ж "coords" ╨╜╨╡╨╗╤M╨╖ C G ╨╖╨░╤B╤M "USING coords::geometry(Point,4326)".
Thank you very much for your help!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
marazmiki, 2016-06-14
@denismatveyev7

This Postgres swears like this:

ERROR: 'coords' column cannot be automatically cast to geometry HINT: Perhaps "USING coords::geometry(Point,4326)" should be specified.

What's in those migrations?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question