Im not able to connect database for deployment

Hello @usama. Did you create the database manually(through psql) and specifically called it chatapp-db or did you use flyctl postgres attach. If the latter is what you did flyctl would have created a database with the same name as the app you are trying to attach a cluster to and injected a DATABASE_URL secret in the app for you.

To see what databases you have in your cluster flyctl pg connect can give access to your cluster psql console(make sure your cluster is running an updated image with flyctl image show) or use any of these options documented here: Postgres on Fly