Database commands
oms database status # what exists, and which migrations are pendingoms database migrate # apply pending migrations (safe to re-run)oms database init # create the role, database, schema and reference dataoms database init --resume # finish an init that failed partway throughoms database drop # destroy the database (the oms role is kept)oms init already runs oms database init for you, after writing oms.toml. Use these
directly to upgrade, inspect, or start over.
init,migrateanddropconnect as the Postgres superuser — they prompt for its password, or take--password/POSTGRES_PASSWORD.statusconnects as theomsrole.initrefuses if the role or the database already exists.--resumecreates only what is missing and re-runs the remaining steps, all of which are safe to repeat.dropagainst a database that is not onlocalhostneeds--yes.- The server itself never creates or migrates anything: after an
update, run
oms database migrate.
oms database statusserver: localhost:5432database: ods (present)role: omsmigrations: 51 applied, 0 pendingWhat’s in it
Section titled “What’s in it”One role, oms, owns everything. The public schema holds shared reference data —
instruments, venues, currencies. The oms schema holds the OMS’s own tables — orders and
their events, portfolios, principals, accounts, positions, and encrypted credentials.