cga-harvard / worldmap

WorldMap GeoNode Project
GNU General Public License v3.0
13 stars 7 forks source link

certification application is missing migrations #76

Closed capooti closed 7 years ago

capooti commented 7 years ago

This cause the following error when running syncdb:

$ ./manage.py syncdb System check identified some issues:

WARNINGS: wm_extra.LayerStats.layer: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField. HINT: ForeignKey(unique=True) is usually better served by a OneToOneField. wm_extra.MapStats.map: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField. HINT: ForeignKey(unique=True) is usually better served by a OneToOneField. Operations to perform: Synchronize unmigrated apps: tasks, floppyforms, modeltranslation, django_extensions, datastore_shards, polymorphic, gis, pinax_theme_bootstrap_account, django_forms_bootstrap, catalogue, humanize, geoserver, api_basemaps, storages, mptt, friendlytagloader, staticfiles, metadataxsl, geoexplorer, sitemaps, proxy, pinax_theme_bootstrap, createlayer, pagination, autocomplete_light, messages, leaflet, api, social, security Apply all migrations: dialogos, people, tastypie, agon_ratings, documents, actstream, wm_extra, sites, maps, contenttypes, announcements, user_messages, layers, sessions, guardian, auth, base, groups, services, oauth2_provider, account, admin, djcelery, upload, avatar, taggit Synchronizing apps without migrations: Creating tables... Creating table datastore_shards_database Running deferred SQL... Installing custom SQL... Running migrations: Rendering model states... DONE Applying sites.0001_initial... OK Applying contenttypes.0001_initial... OK Applying taggit.0001_initial... OK Applying taggit.0002_auto_20150616_2121... OK Applying contenttypes.0002_remove_content_type_name... OK Applying auth.0001_initial... OK Applying auth.0002_alter_permission_name_max_length... OK Applying auth.0003_alter_user_email_max_length... OK Applying auth.0004_alter_user_username_opts... OK Applying auth.0005_alter_user_last_login_null... OK Applying auth.0006_require_contenttypes_0002... OK Applying people.24_initial... OK Applying account.0001_initial... OK Applying account.0002_fix_emailconfirmation_created... OK Applying account.0003_auto_20160822_0917... OK Applying account.0004_auto_20170321_1050... OK Applying actstream.0001_initial... OK Applying actstream.0002_remove_action_data... OK Applying admin.0001_initial... OK Applying agon_ratings.0001_initial... OK Applying announcements.0001_initial... OK Applying avatar.0001_initial... OK Applying base.24_initial... OK Applying base.24_to_26... OK Applying base.26_to_27... OK Applying base.0027_auto_20170801_1228... OK Applying dialogos.0001_initial... OK Applying djcelery.0001_initial... OK Applying documents.24_initial... OK Applying documents.25_add_documentresourcelink_table... OK Applying documents.26_move_data_to_documentresourcelink_table... OK Applying documents.27_drop_resource_columns_from_document_table... OK Applying documents.0028_auto_20170801_1228... OK Applying groups.24_initial... OK Applying groups.26_to_27... OK Applying guardian.0001_initial... OK Applying layers.24_initial... OK Applying layers.24_to_26... OK Applying layers.26_to_27... OK Applying layers.0027_auto_20170801_1228... OK Applying maps.24_initial... OK Applying maps.0025_auto_20170801_1228... OK Applying oauth2_provider.0001_initial... OK Applying oauth2_provider.0002_08_updates... OK Applying oauth2_provider.0003_auto_20160316_1503... OK Applying oauth2_provider.0004_auto_20160525_1623... OK Applying services.24_initial... OK Applying sessions.0001_initial... OK Applying tastypie.0001_initial... OK Applying upload.24_initial... OK Applying user_messages.0001_initial... OK Applying wm_extra.0001_initial... OK Applying wm_extra.0002_endpoint... OK Traceback (most recent call last): File "./manage.py", line 11, in execute_from_command_line(sys.argv) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/core/management/init.py", line 354, in execute_from_command_line utility.execute() File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/core/management/init.py", line 346, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv self.execute(*args, cmd_options) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute output = self.handle(args, options) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 25, in handle call_command("migrate", options) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/core/management/init.py", line 120, in call_command return command.execute(args, defaults) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute output = self.handle(*args, options) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 226, in handle emit_post_migrate_signal(created_models, self.verbosity, self.interactive, connection.alias) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/core/management/sql.py", line 280, in emit_post_migrate_signal using=db) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 189, in send response = receiver(signal=self, sender=sender, named) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/guardian/management/init.py", line 33, in create_anonymous_user User.objects.get(*lookup) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/db/models/manager.py", line 127, in manager_method return getattr(self.get_queryset(), name)(args, **kwargs) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/db/models/query.py", line 328, in get num = len(clone) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/db/models/query.py", line 144, in len self._fetch_all() File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/db/models/query.py", line 965, in _fetch_all self._result_cache = list(self.iterator()) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/db/models/query.py", line 238, in iterator results = compiler.execute_sql() File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 840, in execute_sql cursor.execute(sql, params) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute return super(CursorDebugWrapper, self).execute(sql, params) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/db/utils.py", line 98, in exit six.reraise(dj_exc_type, dj_exc_value, traceback) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) File "/home/vagrant/env_wm/local/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 318, in execute return Database.Cursor.execute(self, query, params) django.db.utils.OperationalError: no such column: people_profile.is_certifier

waybarrios commented 7 years ago

@capooti In the new GeoNode, migration process should do following these steps:

python manage.py makemigrations
python manage.py makemigrations datatables certification
python manage.py migrate
waybarrios commented 7 years ago

The above is referenced on migration script: https://github.com/piensa/worldmap-migration/blob/master/main.sh#L88

waybarrios commented 7 years ago

@capooti If you wanna migrate data from database, this is the script: https://github.com/piensa/worldmap-migration/blob/master/scripts/layers.sh#L143

capooti commented 7 years ago

@waybarrios the initial migration file (which is the output of makemigrations) should be included with source code I think. This is the general rule in django

capooti commented 7 years ago

fixed with this: 9942a899144baaae6b86acfbc464c1412da2cf87