Skip to content

Instantly share code, notes, and snippets.

@mrchrisadams
Last active March 10, 2017 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrchrisadams/3d7edfa5caf552de055641abeb70b199 to your computer and use it in GitHub Desktop.
Save mrchrisadams/3d7edfa5caf552de055641abeb70b199 to your computer and use it in GitHub Desktop.
Y U NO SEE TABLEZ IN DATABASE
-mptt 0.6.  Explicitly define a TreeManager() on your model to remove this warning.
  DeprecationWarning

 - Soft matched migration 0037 to 0037_auto__del_pagemoderator__del_field_globalpagepermission_can_moderate__.
Running migrations for cms:
 - Migrating forwards to 0037_auto__del_pagemoderator__del_field_globalpagepermission_can_moderate__.
 > cms:0037_auto__del_pagemoderator__del_field_globalpagepermission_can_moderate__
FATAL ERROR - The following SQL query failed: DROP TABLE "cms_pagemoderator" CASCADE;
The error was: table "cms_pagemoderator" does not exist

Error in migration: cms:0037_auto__del_pagemoderator__del_field_globalpagepermission_can_moderate__

Okay, there's a bit more info, but the database table should still be visible

# I'm running through updates in sequence hence the old, and busted libraries -- I can't just lift and shift in this case.
appdirs (1.4.3)
awscli (1.11.60)
blessings (1.6)
botocore (1.5.23)
bpython (0.16)
colorama (0.3.7)
curtsies (0.2.11)
Django (1.5.12)
django-classy-tags (0.6.2)
django-cms (2.4.3)
django-filebrowser-no-grappelli (3.6.1)
django-mptt (0.5.1)
django-sekizai (0.10.0)
django-tinymce (2.6.0)
docutils (0.13.1)
futures (3.0.5)
greenlet (0.4.12)
html5lib (0.999)
jmespath (0.9.1)
packaging (16.8)
Pillow (2.7.0)
pip (1.5.6)
psycopg2 (2.4.1)
pyasn1 (0.2.3)
Pygments (2.2.0)
pyparsing (2.2.0)
python-dateutil (2.6.0)
PyYAML (3.12)
raven (5.0.0)
requests (2.13.0)
rsa (3.4.2)
s3transfer (0.1.10)
setuptools (34.3.1)
simplejson (3.6.3)
six (1.10.0)
South (0.7.3)
Unipath (1.0)
wcwidth (0.1.7)
webencodings (0.5)
wsgiref (0.1.2)
(update_venv)~/C/j/w/client_site_update ❯❯❯ ./manage.py migrate cms 0037


 - Soft matched migration 0037 to 0037_auto__del_pagemoderator__del_field_globalpagepermission_can_moderate__.
Running migrations for cms:
 - Migrating forwards to 0037_auto__del_pagemoderator__del_field_globalpagepermission_can_moderate__.
 > cms:0037_auto__del_pagemoderator__del_field_globalpagepermission_can_moderate__
DatabaseError: table "cms_pagemoderator" does not exist

Strange. Let's look in the database:

psql client_database
psql (9.6.2, server 9.4.1)
Type "help" for help.

[local]/client_database=# \d
                                   List of relations
 Schema |                         Name                         |   Type   |   Owner
--------+------------------------------------------------------+----------+------------
 public | cms_cmsplugin                                        | table    | chrisadams
 public | cms_cmsplugin_id_seq                                 | sequence | chrisadams
 public | cms_globalpagepermission                             | table    | chrisadams
 public | cms_globalpagepermission_id_seq                      | sequence | chrisadams
 public | cms_globalpagepermission_sites                       | table    | chrisadams
 public | cms_globalpagepermission_sites_id_seq                | sequence | chrisadams
 public | cms_page                                             | table    | chrisadams
 public | cms_page_id_seq                                      | sequence | chrisadams
 
 public | cms_pagemoderator                                    | table    | chrisadams
 public | cms_pagemoderator_id_seq                             | sequence | chrisadams
 public | cms_pagemoderatorstate                               | table    | chrisadams
 public | cms_pagemoderatorstate_id_seq                        | sequence | chrisadams
 
 public | cms_pagepermission                                   | table    | chrisadams
 public | cms_pagepermission_id_seq                            | sequence | chrisadams
 public | cms_pageuser                                         | table    | chrisadams
 public | cms_pageusergroup                                    | table    | chrisadams
 public | cms_title                                            | table    | chrisadams
 public | cms_title_id_seq                                     | sequence | chrisadams

The table is clearly there.

Perhaps the table doesn't have any columns?

[local]/client_database=# SELECT * from cms_pagemoderator
;
 id | page_id | user_id | moderate_page | moderate_children | moderate_descendants
----+---------+---------+---------------+-------------------+----------------------
(0 rows)

Nope. They're there. Why would South not not see the table? The db users speaking to the database is chrisadams in both cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment