-- Postgres supports `IF NOT EXISTS` syntax when creating indexes. -- If an index already exists with the same name, it will not be duplicated. -- However, you should still review your pre-existing indexes in advance -- to make sure you do not already have one or more of the same indexes -- defined under a different name. If so, you should omit them -- from what you apply to your Postgres database. CREATE INDEX CONCURRENTLY IF NOT EXISTS idx84931j3o4l72echafhvl5b396 ON blc_saved_payment_method(originating_payment_id); CREATE INDEX CONCURRENTLY IF NOT EXISTS idx9f7ew6enfhj96ituhk8u12n4i ON blc_saved_payment_method(owning_user_id); CREATE INDEX CONCURRENTLY IF NOT EXISTS idxtjvikdatat8etrnqk13yqxfdf ON blc_payment_transaction(request_id); CREATE INDEX CONCURRENTLY IF NOT EXISTS idxvsrmtlej61uxhx0yiwpb2rcrv ON blc_notification_state(acked, stopped, notification_name, change_timestamp, next_attempt);