Skip to content

Commit

Permalink
[#3009] Add dashboard table migration script
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Nov 6, 2012
1 parent af1e3fc commit 7202c92
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ckan/migration/versions/061_add_dashboard_table.py
@@ -0,0 +1,16 @@
from sqlalchemy import *
from migrate import *

def upgrade(migrate_engine):
metadata = MetaData()
metadata.bind = migrate_engine
migrate_engine.execute('''
CREATE TABLE dashboard (
user_id text NOT NULL,
activity_stream_last_viewed timestamp without time zone NOT NULL
);
ALTER TABLE dashboard
ADD CONSTRAINT dashboard_pkey PRIMARY KEY (user_id);
ALTER TABLE dashboard
ADD CONSTRAINT dashboard_user_id_fkey FOREIGN KEY (user_id) REFERENCES "user"(id) ON UPDATE CASCADE ON DELETE CASCADE;
''')

0 comments on commit 7202c92

Please sign in to comment.