Skip to content

Commit

Permalink
[#730] Add tracking_raw_table to model
Browse files Browse the repository at this point in the history
The tracking_raw table was being created by a migration script, but was
not actually defined anywhere in ckan's model. This means that in tests,
ckan.model.rebuild_db() would not clear the tracking_raw table, and the
old data would then leak it into tracking_summary as well. Adding
tracking_raw to the model makes rebuild_db() behave as expected again.
  • Loading branch information
Sean Hammond committed Apr 6, 2013
1 parent b0ce83c commit 43516bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions ckan/model/__init__.py
Expand Up @@ -101,6 +101,7 @@
from tracking import (
tracking_summary_table,
TrackingSummary,
tracking_raw_table
)
from rating import (
Rating,
Expand Down
10 changes: 9 additions & 1 deletion ckan/model/tracking.py
Expand Up @@ -3,7 +3,15 @@
import meta
import domain_object

__all__ = ['tracking_summary_table', 'TrackingSummary']
__all__ = ['tracking_summary_table', 'TrackingSummary', 'tracking_raw_table']

tracking_raw_table = Table('tracking_raw', meta.metadata,
Column('user_key', types.Unicode(100), nullable=False),
Column('url', types.UnicodeText, nullable=False),
Column('tracking_type', types.Unicode(10), nullable=False),
Column('access_timestamp', types.DateTime),
)


tracking_summary_table = Table('tracking_summary', meta.metadata,
Column('url', types.UnicodeText, primary_key=True, nullable=False),
Expand Down

0 comments on commit 43516bf

Please sign in to comment.