Skip to content

Commit

Permalink
Merge branch 'feature-1515-activity-streams' of github.com:okfn/ckan …
Browse files Browse the repository at this point in the history
…into feature-1515-activity-streams
  • Loading branch information
Sean Hammond committed Jan 18, 2012
2 parents 0c2107a + afe155b commit 4cdbe80
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions ckan/migration/versions/048_add_activity_streams_tables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from sqlalchemy import *
from migrate import *

def upgrade(migrate_engine):
metadata = MetaData()
metadata.bind = migrate_engine
migrate_engine.execute('''
CREATE TABLE activity (
id text NOT NULL,
timestamp timestamp without time zone,
user_id text,
object_id text,
revision_id text,
activity_type text,
data text
);
CREATE TABLE activity_detail (
id text NOT NULL,
activity_id text NOT NULL,
object_id text,
object_type text,
activity_type text,
data text
);
ALTER TABLE activity
ADD CONSTRAINT activity_pkey PRIMARY KEY (id);
ALTER TABLE activity_detail
ADD CONSTRAINT activity_detail_pkey PRIMARY KEY (id);
ALTER TABLE activity_detail
ADD CONSTRAINT activity_detail_activity_id_fkey FOREIGN KEY (activity_id) REFERENCES activity(id);
''')

0 comments on commit 4cdbe80

Please sign in to comment.