Salz0 / telegram_flea

A open-source flea market bot, to be used in any Community
MIT License
9 stars 21 forks source link

Connect PostgreSQL #45

Closed bodamat closed 9 months ago

bodamat commented 10 months ago

Connect to PostgreSQL on startup of the bot and disconnect the db when bot shutdown. Also at strartup add info about bot to the db

To test it, should add PostgreSQL connect url to .env file to key DATABASE_URL

Salz0 commented 10 months ago

Fire, will review soon

Salz0 commented 10 months ago

Could you please resolve the conflicts or create a new PR?

Salz0 commented 10 months ago

@mykolasolodukha could you take a look at this PR, can't run Docker for no apparent reason 🙏

Salz0 commented 9 months ago

Thanks a lot bro!

mykolasolodukha commented 9 months ago

@bodamat at your revision, there's no .DATABASE_URL in settings.settings (link), so the bot fails with

AttributeError: 'Settings' object has no attribute 'DATABASE_URL'

... and .DATABASE_URL is used in utils/tortoise_orm.py

Please be a bit more careful next time 🙂

CC @Salz0

Salz0 commented 9 months ago

@bodamat at your revision, there's no .DATABASE_URL in settings.settings (link), so the bot fails with

AttributeError: 'Settings' object has no attribute 'DATABASE_URL'

... and .DATABASE_URL is used in utils/tortoise_orm.py

Please be a bit more careful next time 🙂

CC @Salz0

Preparing a big release with this fix