PostgreSQL Schema

The User Service stores the user profile in the shared FloatMe PostgreSQL instance (ebdb database) in us-east-2, reached through the {env}/rds/main (writes) and {env}/rds/replica (reads) pools. With USE_LEGACY_ONLY=true (both environments) this table is the source of truth for the profile; the DynamoDB USER entity is a cache that is only populated when the flag is off — see DynamoDB Tables.

FloatMeAPI_usermodel

One row per user. Written by Add (insert) and Update (full-row update) in the user repository; read by every user lookup, the paged GetUsersByDateJoined listing and the UserSearch / UserAddressSearch queries.

Column Description

user_id

Primary key; Auth0 user identifier

first_name, last_name

Name

email

Email address

address, city, state, zip_code

Postal address

date_joined

Row creation time

date_updated

Set on every update

employment_validation

Account status; the column name predates its use — values in User Status

install_id

Firebase messaging install ID (nullable, read as empty string)

firebase_instance_id

Firebase instance ID (nullable)

appsflyer_id

AppsFlyer attribution ID (nullable)

app_platform

ios or android (nullable)

app_version, app_build_number

Client build (nullable)

Source: pkg/repository/users.go

The phone number is not a column: it is read from and written to the user-phone-numbers DynamoDB table and merged into the user on read — user-phone-numbers.

UserSearch matches any combination of query, name, email, phone, address fields and status; UserAddressSearch matches the address fields against a free-text query. Both page with limit (default 25, max 200) and offset, sort by last_name, first_name unless sort_by / sort are given, and return the total via COUNT(*) OVER(). GetUsersByDateJoined pages by date_joined from a cursor user_id.

Source: pkg/repository/users.go

FloatMeAPI_userloansmodel (read only)

The Float Service’s float table, read through the replica by HasActiveFloat during account closure: a user has an active float when a row exists with ach_debit_status in RETRY, DEFAULTED, SCHEDULING, ACHSENT, UNCOLLECTABLE. See Cancellation.

Source: pkg/repository/memberships.go