Do not use repo.are_tables_created

When checking whether the core tables have been alredy created  it is
best to use package_table.exists(), as are_tables_created reflects the
tables, causing conflicts with other extensions.

This allows ckanext-harvest and ckanext-spatial to be used together on
ckan 1.8 onwards.
This commit is contained in:
amercader 2012-08-09 11:02:13 +01:00
parent 9bc3759bd1
commit b784be8f9e
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ def setup(srid=None):
define_spatial_tables(srid)
log.debug('Spatial tables defined in memory')
if model.repo.are_tables_created():
if model.package_table.exists():
if not Table('geometry_columns',meta.metadata).exists() or \
not Table('spatial_ref_sys',meta.metadata).exists():
raise Exception('The spatial extension is enabled, but PostGIS ' + \