def setup_db(connection_string):
db = dataset.connect(connection_string)
pages = db['page']
users = db['user']
posts = db['post']
comments = db['comment']
interactions = db['interaction']
users.create_index(['user_id'])
posts.create_index(['post_id'])
comments.create_index(['comment_id'])
comments.create_index(['post_id'])
interactions.create_index(['comment_id'])
interactions.create_index(['post_id'])
interactions.create_index(['user_id'])
return db
评论列表
文章目录