Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLAlchemy requires extend_existing #117

Open
florianm opened this issue Oct 9, 2015 · 0 comments · May be fixed by #118
Open

SQLAlchemy requires extend_existing #117

florianm opened this issue Oct 9, 2015 · 0 comments · May be fixed by #118

Comments

@florianm
Copy link

florianm commented Oct 9, 2015

Datacats CKAN "latest" (2.5a) with our ckanext-spatial fork which is exactly up to date with upstream/master.

With SQLAlchemy==0.9.6 installed, booting up CKAN trips when spatial inits their tables.
SQLAlchemy defaults to creating/updating tables with Table(..., column defs, extend_existing=False), we'll need True:

  File "/project/ckanext-spatial/ckanext/spatial/plugin.py", line 78, in configure
    setup_model()
  File "/project/ckanext-spatial/ckanext/spatial/model/package_extent.py", line 22, in setup
    define_spatial_tables(srid)
  File "/project/ckanext-spatial/ckanext/spatial/model/package_extent.py", line 69, in define_spatial_tables
    package_extent_table = setup_spatial_table(PackageExtent, db_srid)
  File "/project/ckanext-spatial/ckanext/spatial/geoalchemy_common.py", line 74, in setup_spatial_table
    management=management)),
  File "/usr/lib/ckan/local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py", line 339, in __new__
    "existing Table object." % key)
sqlalchemy.exc.InvalidRequestError: Table 'package_extent' is already defined for this MetaData instance.  Specify 'extend_existing=True' to redefine options and columns on an existing Table object.
Starting subprocess with file monitor

This sounds similar to ckan/ckanext-pages#27. I'll attempt a fix now, if you don't hear a PR from me, send coffee and help.

florianm pushed a commit to florianm/ckanext-spatial that referenced this issue Oct 9, 2015
florianm pushed a commit to datawagovau/ckanext-spatial that referenced this issue Oct 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant