-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature-1515-activity-streams' of github.com:okfn/ckan …
…into feature-1515-activity-streams
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
ckan/migration/versions/048_add_activity_streams_tables.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
''') |