DB Downtime while indexing a existing record postgres

No downtime but some queries might be delayed until the indexing finishes.

However, PostgreSQL supports CREATE INDEX CONCURRENTLY for a long time now (at least from 9.6 and on): PostgreSQL: Documentation: 13: CREATE INDEX

Check out the docs of Migration.index – there’s a :concurrently option available.