1 # ================================================================================
2 # Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved.
3 # ================================================================================
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 # ============LICENSE_END=========================================================
17 """ ORM - mapping class for dtih_event table """
19 from sqlalchemy import Column, String, Integer, ForeignKey, func
20 from sqlalchemy.dialects.postgresql import JSONB, TIMESTAMP
21 from sqlalchemy.ext.declarative import declarative_base
25 Base = declarative_base()
28 __tablename__ = 'dtih_event'
29 __table_args__ = {'schema': 'dti'}
30 dtih_event_id = Column(Integer, primary_key=True)
32 create_ts = Column(TIMESTAMP(timezone=True), default=func.now())
33 last_modified_ts = Column(TIMESTAMP(timezone=True), default=func.now())
34 target_name = Column(String)
35 target_type = Column(String)
36 location_clli = Column(String)
38 # return "<Event(event_id='%s', target_type='%s', target_name='%s')" % (
39 # self.event_id, self.target_type, self.target_name