-
Notifications
You must be signed in to change notification settings - Fork 1
/
models.py
40 lines (36 loc) · 1.24 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from flask import Flask
from flask_dynamo import Dynamo
app = Flask(__name__)
app.config['DYNAMO_TABLES'] = [
dict(
TableName='actor_game',
KeySchema=[dict(AttributeName='game_id', KeyType='HASH')],
AttributeDefinitions=[dict(AttributeName='game_id', AttributeType='S')],
ProvisionedThroughput=dict(ReadCapacityUnits=5, WriteCapacityUnits=5)
),
dict(
TableName='actor_users',
KeySchema=[
dict(AttributeName='summoner_name', KeyType='HASH'),
],
AttributeDefinitions=[
dict(AttributeName='summoner_name', AttributeType='S'),
],
ProvisionedThroughput=dict(ReadCapacityUnits=5, WriteCapacityUnits=5)
),
dict(
TableName='lol_analytics_table_v2',
KeySchema=[
dict(AttributeName='champion_id', KeyType='HASH'),
dict(AttributeName='champion_name', KeyType='RANGE'),
],
AttributeDefinitions=[
dict(AttributeName='champion_id', AttributeType='S'),
dict(AttributeName='champion_name', AttributeType='S'),
],
ProvisionedThroughput=dict(ReadCapacityUnits=5, WriteCapacityUnits=5)
),
]
dynamo = Dynamo(app)
with app.app_context():
dynamo.create_all()