Make baby-trigger items (i.e., incense) a foreign key. #337

This commit is contained in:
Eevee 2010-09-01 23:24:21 -07:00
parent 0fcdb6bcc9
commit 497c3aa0f0
2 changed files with 12 additions and 11 deletions

View file

@ -1,4 +1,4 @@
id,growth_rate_id,baby_trigger_item id,growth_rate_id,baby_trigger_item_id
1,4, 1,4,
2,4, 2,4,
3,4, 3,4,
@ -49,13 +49,13 @@ id,growth_rate_id,baby_trigger_item
48,2, 48,2,
49,2, 49,2,
50,1, 50,1,
51,3,Luck Incense 51,3,296
52,2, 52,2,
53,2, 53,2,
54,2, 54,2,
55,2, 55,2,
56,1, 56,1,
57,2,Odd Incense 57,2,291
58,2, 58,2,
59,2, 59,2,
60,2, 60,2,
@ -70,7 +70,7 @@ id,growth_rate_id,baby_trigger_item
69,2, 69,2,
70,2, 70,2,
71,1, 71,1,
72,1,Full Incense 72,1,293
73,1, 73,1,
74,1, 74,1,
75,1, 75,1,
@ -88,8 +88,8 @@ id,growth_rate_id,baby_trigger_item
87,3, 87,3,
88,2, 88,2,
89,4, 89,4,
90,3,Sea Incense 90,3,231
91,2,Rock Incense 91,2,292
92,4, 92,4,
93,3, 93,3,
94,4, 94,4,
@ -98,7 +98,7 @@ id,growth_rate_id,baby_trigger_item
97,4, 97,4,
98,3, 98,3,
99,2, 99,2,
100,2,Lax Incense 100,2,232
101,2, 101,2,
102,2, 102,2,
103,2, 103,2,
@ -114,7 +114,7 @@ id,growth_rate_id,baby_trigger_item
113,3, 113,3,
114,2, 114,2,
115,3, 115,3,
116,1,Wave Incense 116,1,294
117,1, 117,1,
118,1, 118,1,
119,2, 119,2,
@ -156,7 +156,7 @@ id,growth_rate_id,baby_trigger_item
155,2, 155,2,
156,5, 156,5,
157,6, 157,6,
158,4,Rose Incense 158,4,295
159,6, 159,6,
160,1, 160,1,
161,6, 161,6,
@ -182,7 +182,7 @@ id,growth_rate_id,baby_trigger_item
181,3, 181,3,
182,3, 182,3,
183,1, 183,1,
184,3,Pure Incense 184,3,297
185,4, 185,4,
186,2, 186,2,
187,4, 187,4,

1 id growth_rate_id baby_trigger_item baby_trigger_item_id
2 1 4
3 2 4
4 3 4
49 48 2
50 49 2
51 50 1
52 51 3 Luck Incense 296
53 52 2
54 53 2
55 54 2
56 55 2
57 56 1
58 57 2 Odd Incense 291
59 58 2
60 59 2
61 60 2
70 69 2
71 70 2
72 71 1
73 72 1 Full Incense 293
74 73 1
75 74 1
76 75 1
88 87 3
89 88 2
90 89 4
91 90 3 Sea Incense 231
92 91 2 Rock Incense 292
93 92 4
94 93 3
95 94 4
98 97 4
99 98 3
100 99 2
101 100 2 Lax Incense 232
102 101 2
103 102 2
104 103 2
114 113 3
115 114 2
116 115 3
117 116 1 Wave Incense 294
118 117 1
119 118 1
120 119 2
156 155 2
157 156 5
158 157 6
159 158 4 Rose Incense 295
160 159 6
161 160 1
162 161 6
182 181 3
183 182 3
184 183 1
185 184 3 Pure Incense 297
186 185 4
187 186 2
188 187 4

View file

@ -177,7 +177,7 @@ class EvolutionChain(TableBase):
__tablename__ = 'evolution_chains' __tablename__ = 'evolution_chains'
id = Column(Integer, primary_key=True, nullable=False) id = Column(Integer, primary_key=True, nullable=False)
growth_rate_id = Column(Integer, ForeignKey('growth_rates.id'), nullable=False) growth_rate_id = Column(Integer, ForeignKey('growth_rates.id'), nullable=False)
baby_trigger_item = Column(Unicode(12)) baby_trigger_item_id = Column(Integer, ForeignKey('items.id'), nullable=True)
class EvolutionTrigger(TableBase): class EvolutionTrigger(TableBase):
__tablename__ = 'evolution_triggers' __tablename__ = 'evolution_triggers'
@ -759,6 +759,7 @@ EncounterSlotCondition.condition = relation(EncounterCondition,
backref='slot_map') backref='slot_map')
EvolutionChain.growth_rate = relation(GrowthRate, backref='evolution_chains') EvolutionChain.growth_rate = relation(GrowthRate, backref='evolution_chains')
EvolutionChain.baby_trigger_item = relation(Item, backref='evolution_chains')
Experience.growth_rate = relation(GrowthRate, backref='experience_table') Experience.growth_rate = relation(GrowthRate, backref='experience_table')