source: mauRepo/MolesManager/trunk/src/libs/migration/db/migrationTables.py @ 8015

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/libs/migration/db/migrationTables.py@8015
Revision 8015, 1.2 KB checked in by mnagni, 9 years ago (diff)

implemented a prototype for the cedaObservation.
Further implementation for the Moles2 migration

Line 
1'''
2Created on 15 Nov 2011
3
4@author: mnagni
5'''
6from sqlalchemy.schema import Table, Column
7from sqlalchemy.types import TEXT, Integer, TIMESTAMP
8from sqlalchemy.orm import mapper
9from libs.migration.db.classes import ObservationCollectionMigration,\
10    ObservationMigration
11
12'''
13Connects a dataEntity to its associated CEDA_Observation_Collection
14'''       
15obs_coll_migration = Table('obs_coll_migration', metadata,
16            Column('data_ent_id', TEXT, primary_key=True, nullable=False),
17            Column('data_ent_name', TEXT),           
18            Column('obs_coll_id', Integer),
19            Column('data_ent_creation', TIMESTAMP),
20            Column('exist_path', TEXT)
21        )
22
23'''
24Connects a deployment to its associated CEDA_Observation
25'''
26observation_migration = Table('observation_migration', metadata,
27            Column('depl_id', TEXT, primary_key=True, nullable=False),
28            Column('depl_name', TEXT),           
29            Column('obs_id', Integer),
30            Column('depl_creation', TIMESTAMP),
31            Column('exist_path', TEXT)           
32        )   
33
34mapper(ObservationCollectionMigration, obs_coll_migration)     
35mapper(ObservationMigration, observation_migration)
36
37metadata.create_all(engine)
Note: See TracBrowser for help on using the repository browser.