From 3031a2e3f412d6fd4ef397f5336792638d849e83 Mon Sep 17 00:00:00 2001 From: Eevee Date: Sun, 9 Aug 2009 23:07:23 -0700 Subject: [PATCH] Added machines table. --- pokedex/data/csv/machines.csv | 271 ++++++++++++++++++++++++++++++++++++++++++ pokedex/db/tables.py | 9 ++ 2 files changed, 280 insertions(+) create mode 100644 pokedex/data/csv/machines.csv diff --git a/pokedex/data/csv/machines.csv b/pokedex/data/csv/machines.csv new file mode 100644 index 0000000..66a4a81 --- /dev/null +++ b/pokedex/data/csv/machines.csv @@ -0,0 +1,271 @@ +machine_number,generation_id,move_id +1,1,5 +1,2,223 +1,3,264 +1,4,264 +2,1,13 +2,2,29 +2,3,337 +2,4,337 +3,1,14 +3,2,174 +3,3,352 +3,4,352 +4,1,18 +4,2,205 +4,3,347 +4,4,347 +5,1,25 +5,2,46 +5,3,46 +5,4,46 +6,1,92 +6,2,92 +6,3,92 +6,4,92 +7,1,32 +7,2,192 +7,3,258 +7,4,258 +8,1,34 +8,2,249 +8,3,339 +8,4,339 +9,1,36 +9,2,244 +9,3,331 +9,4,331 +10,1,38 +10,2,237 +10,3,237 +10,4,237 +11,1,61 +11,2,241 +11,3,241 +11,4,241 +12,1,55 +12,2,230 +12,3,269 +12,4,269 +13,1,58 +13,2,173 +13,3,58 +13,4,58 +14,1,59 +14,2,59 +14,3,59 +14,4,59 +15,1,63 +15,2,63 +15,3,63 +15,4,63 +16,1,6 +16,2,196 +16,3,113 +16,4,113 +17,1,66 +17,2,182 +17,3,182 +17,4,182 +18,1,68 +18,2,240 +18,3,240 +18,4,240 +19,1,69 +19,2,202 +19,3,202 +19,4,202 +20,1,99 +20,2,203 +20,3,219 +20,4,219 +21,1,72 +21,2,218 +21,3,218 +21,4,218 +22,1,76 +22,2,76 +22,3,76 +22,4,76 +23,1,82 +23,2,231 +23,3,231 +23,4,231 +24,1,85 +24,2,225 +24,3,85 +24,4,85 +25,1,87 +25,2,87 +25,3,87 +25,4,87 +26,1,89 +26,2,89 +26,3,89 +26,4,89 +27,1,90 +27,2,216 +27,3,216 +27,4,216 +28,1,91 +28,2,91 +28,3,91 +28,4,91 +29,1,94 +29,2,94 +29,3,94 +29,4,94 +30,1,100 +30,2,247 +30,3,247 +30,4,247 +31,1,102 +31,2,189 +31,3,280 +31,4,280 +32,1,104 +32,2,104 +32,3,104 +32,4,104 +33,1,115 +33,2,8 +33,3,115 +33,4,115 +34,1,117 +34,2,207 +34,3,351 +34,4,351 +35,1,118 +35,2,214 +35,3,53 +35,4,53 +36,1,120 +36,2,188 +36,3,188 +36,4,188 +37,1,121 +37,2,201 +37,3,201 +37,4,201 +38,1,126 +38,2,126 +38,3,126 +38,4,126 +39,1,129 +39,2,129 +39,3,317 +39,4,317 +40,1,130 +40,2,111 +40,3,332 +40,4,332 +41,1,135 +41,2,9 +41,3,259 +41,4,259 +42,1,138 +42,2,138 +42,3,263 +42,4,263 +43,1,143 +43,2,197 +43,3,290 +43,4,290 +44,1,156 +44,2,156 +44,3,156 +44,4,156 +45,1,86 +45,2,213 +45,3,213 +45,4,213 +46,1,149 +46,2,168 +46,3,168 +46,4,168 +47,1,153 +47,2,211 +47,3,211 +47,4,211 +48,1,157 +48,2,7 +48,3,285 +48,4,285 +49,1,161 +49,2,210 +49,3,289 +49,4,289 +50,1,164 +50,2,171 +50,3,315 +50,4,315 +51,4,355 +52,4,411 +53,4,412 +54,4,206 +55,4,362 +56,4,374 +57,4,451 +58,4,203 +59,4,406 +60,4,409 +61,4,261 +62,4,318 +63,4,373 +64,4,153 +65,4,421 +66,4,371 +67,4,278 +68,4,416 +69,4,397 +70,4,148 +71,4,444 +72,4,419 +73,4,86 +74,4,360 +75,4,14 +76,4,446 +77,4,244 +78,4,445 +79,4,399 +80,4,157 +81,4,404 +82,4,214 +83,4,363 +84,4,398 +85,4,138 +86,4,447 +87,4,207 +88,4,365 +89,4,369 +90,4,164 +91,4,430 +92,4,433 +101,1,15 +101,2,15 +101,3,15 +101,4,15 +102,1,19 +102,2,19 +102,3,19 +102,4,19 +103,1,57 +103,2,57 +103,3,57 +103,4,57 +104,1,70 +104,2,70 +104,3,70 +104,4,70 +105,1,148 +105,2,148 +105,3,148 +105,4,432 +106,2,250 +106,3,249 +106,4,249 +107,2,127 +107,3,127 +107,4,127 +108,3,291 +108,4,431 diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index d2a0e77..cedc6a4 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -156,6 +156,12 @@ class LocationArea(TableBase): internal_id = Column(Integer, nullable=False) name = Column(Unicode(64), nullable=True) +class Machine(TableBase): + __tablename__ = 'machines' + machine_number = Column(Integer, primary_key=True, nullable=False, autoincrement=False) + generation_id = Column(Integer, ForeignKey('generations.id'), primary_key=True, nullable=False, autoincrement=False) + move_id = Column(Integer, ForeignKey('moves.id'), nullable=False) + class MoveEffect(TableBase): __tablename__ = 'move_effects' id = Column(Integer, primary_key=True, nullable=False) @@ -376,8 +382,11 @@ EvolutionChain.growth_rate = relation(GrowthRate, backref='evolution_chains') LocationArea.location = relation(Location, backref='areas') +Machine.generation = relation(Generation) + Move.type = relation(Type, backref='moves') Move.effect = relation(MoveEffect, backref='moves') +Move.machines = relation(Machine, backref='move') Pokemon.abilities = relation(Ability, secondary=PokemonAbility.__table__, order_by=PokemonAbility.slot, -- 2.7.4