[model]: More careful about creating tables, since paster db upgrade loads the envrionment and therefore runs setup() before it does the migrations, and therefore in this instance we do not want to create the db tables.
This commit is contained in:
parent
7927329536
commit
dd00e98d9d
|
@ -1,6 +1,7 @@
|
||||||
import logging
|
import logging
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
from ckan import model
|
||||||
from ckan.model.meta import *
|
from ckan.model.meta import *
|
||||||
from ckan.model.types import make_uuid
|
from ckan.model.types import make_uuid
|
||||||
from ckan.model.core import *
|
from ckan.model.core import *
|
||||||
|
@ -28,7 +29,12 @@ harvest_object_error_table = None
|
||||||
def setup():
|
def setup():
|
||||||
if harvest_source_table is None:
|
if harvest_source_table is None:
|
||||||
create_harvester_tables()
|
create_harvester_tables()
|
||||||
metadata.create_all()
|
log.debug('Harvest tables defined in memory')
|
||||||
|
if model.repo.are_tables_created():
|
||||||
|
metadata.create_all()
|
||||||
|
log.debug('Harvest tables created')
|
||||||
|
else:
|
||||||
|
log.debug('Harvest table creation deferred')
|
||||||
|
|
||||||
|
|
||||||
class HarvestError(Exception):
|
class HarvestError(Exception):
|
||||||
|
|
Loading…
Reference in New Issue