Skip to content
This repository has been archived by the owner on Apr 1, 2022. It is now read-only.

Change DB Configuration from sqlite to Postgres #27

Open
Awinja-j opened this issue Jul 18, 2020 · 5 comments
Open

Change DB Configuration from sqlite to Postgres #27

Awinja-j opened this issue Jul 18, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Awinja-j
Copy link
Contributor

Awinja-j commented Jul 18, 2020

Describe the bug

Currently, the code has SQLite configuration, this should be changed to Postgres as it is supported by Heroku

What is the DB being used for?

The DB will store user information and the user's current stage in the bot.
The stages are in reference to gamification which will happen in the future.
The DB will also store all the messages that will be used in the bot.

Model structure

Messages
Index| Message| response_id| gif_id
Users
index| Full_name| game_stage|

Steps to take

  1. Install psycopg2
  2. Install flask-sqlalchemy
  3. freeze requirements.txt
  4. create models folder and add -> init.py, game_users.py, messages.py
  5. add tests
@Awinja-j Awinja-j added enhancement New feature or request help wanted Extra attention is needed labels Jul 18, 2020
@vj-codes
Copy link
Contributor

@aboullaite I would like to fix this!
psycopg and flask sqlachemy should be done in requirements.txt right?

@Awinja-j
Copy link
Contributor Author

@vj-codes yes!

@Awinja-j Awinja-j self-assigned this Jul 28, 2020
@vj-codes
Copy link
Contributor

@elinguiuriel the latest version of psycopg is psycopg2 should that be installed instead?

@Awinja-j
Copy link
Contributor Author

@vj-codes yes, install the latest version.

@prilcool
Copy link
Contributor

prilcool commented Aug 2, 2020

Yes I agree we should use MySQL or PostgreSQL .

Sqlite should not be used if this is going to be a large scale application since sqlite handles read/write operations in a serialized way this will create bottle necks

@vj-codes vj-codes mentioned this issue Aug 7, 2020
11 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants