Trait_* models have incorrect type for key

Each of the TraitText, TraintInt, TraitFloat
and TraitDatetime have key column which has
its type defined incorrectly as Integer. The
migrate script correctly defines the type as
String(255).

This fix updates the sqlalchemy Trait* models
to define key as String(255).

Closes-Bug: 1449752

Change-Id: I5ac2e9b811e3baa53e329732233cd0011a4d25b9
This commit is contained in:
Rohit Jaiswal 2015-04-28 16:03:43 -07:00
parent 9f76e5b580
commit b11d24afe7
2 changed files with 11 additions and 11 deletions

View File

@ -93,25 +93,25 @@ class Connection(base.Connection):
- TraitInt - TraitInt
- int trait value - int trait value
- { event_id: event -> event.id - { event_id: event -> event.id
key: trait type key: trait name
value: integer value value: integer value
} }
- TraitDatetime - TraitDatetime
- int trait value - datetime trait value
- { event_id: event -> event.id - { event_id: event -> event.id
key: trait type key: trait name
value: datetime value value: datetime value
} }
- TraitText - TraitText
- int trait value - text trait value
- { event_id: event -> event.id - { event_id: event -> event.id
key: trait type key: trait name
value: text value value: text value
} }
- TraitFloat - TraitFloat
- int trait value - float trait value
- { event_id: event -> event.id - { event_id: event -> event.id
key: trait type key: trait name
value: float value value: float value
} }

View File

@ -343,7 +343,7 @@ class TraitText(Base):
Index('ix_trait_text_event_id_key', 'event_id', 'key'), Index('ix_trait_text_event_id_key', 'event_id', 'key'),
) )
event_id = Column(Integer, ForeignKey('event.id'), primary_key=True) event_id = Column(Integer, ForeignKey('event.id'), primary_key=True)
key = Column(Integer, primary_key=True) key = Column(String(255), primary_key=True)
value = Column(Text) value = Column(Text)
@ -355,7 +355,7 @@ class TraitInt(Base):
Index('ix_trait_int_event_id_key', 'event_id', 'key'), Index('ix_trait_int_event_id_key', 'event_id', 'key'),
) )
event_id = Column(Integer, ForeignKey('event.id'), primary_key=True) event_id = Column(Integer, ForeignKey('event.id'), primary_key=True)
key = Column(Integer, primary_key=True) key = Column(String(255), primary_key=True)
value = Column(Integer) value = Column(Integer)
@ -367,7 +367,7 @@ class TraitFloat(Base):
Index('ix_trait_float_event_id_key', 'event_id', 'key'), Index('ix_trait_float_event_id_key', 'event_id', 'key'),
) )
event_id = Column(Integer, ForeignKey('event.id'), primary_key=True) event_id = Column(Integer, ForeignKey('event.id'), primary_key=True)
key = Column(Integer, primary_key=True) key = Column(String(255), primary_key=True)
value = Column(Float(53)) value = Column(Float(53))
@ -379,5 +379,5 @@ class TraitDatetime(Base):
Index('ix_trait_datetime_event_id_key', 'event_id', 'key'), Index('ix_trait_datetime_event_id_key', 'event_id', 'key'),
) )
event_id = Column(Integer, ForeignKey('event.id'), primary_key=True) event_id = Column(Integer, ForeignKey('event.id'), primary_key=True)
key = Column(Integer, primary_key=True) key = Column(String(255), primary_key=True)
value = Column(PreciseTimestamp()) value = Column(PreciseTimestamp())