Commit | Line | Data |
---|---|---|
1 | from sqlalchemy import * | |
2 | from sqlalchemy.ext.declarative import declarative_base | |
3 | ||
4 | engine = create_engine('sqlite:///rainbow.db', echo=False) | |
5 | Base = declarative_base() | |
6 | ||
7 | class Map(Base): | |
8 | ||
9 | __tablename__ = "map" | |
10 | ||
11 | rainbow_id = Column(Integer, primary_key=True) | |
12 | tweet_id = Column(Integer) | |
13 | ||
14 | def __init__(self, tweet_id): | |
15 | self.tweet_id = tweet_id | |
16 | ||
17 | def init_db(): | |
18 | Base.metadata.create_all(engine) |