Database
Postgres, one engine. There is no schema migration system — the schema is the entity files.
How this page was verified
Read on 2026-09-15 from src/database/database-config.service.ts and the module entity files in def-exsport-backend.
One engine
Exsport is Postgres only (TypeORM + pg). None of INACT's cross-driver SQL rules apply here — plain Postgres SQL is fine.
The schema is the entities
The backend runs TypeORM with synchronize: true (src/database/database-config.service.ts). On boot it loads every *.model.ts / *.entity.ts (entities: [__dirname + '/../**/*.{entity,model}{.ts,.js}'], autoLoadEntities: true) and creates or alters tables to match.
What follows from that:
- There is no migrations folder and no seed scripts. A table exists because an entity file says
@Entity({ name: '...' }). To change the schema, change the entity. synchronize: truewill alter a live schema to match the code. Be careful pointing a branch with entity changes at a snapshot you care about; it can drop or change columns.- "Seeding" is a set of REST endpoints, not scripts:
POST admins/seed-settings,POST vouchers/seed-voucher-types,POST vouchers/seed-payment-methods,POST vouchers/seed-shipping-couriers,POST discounts/seed-discount-types.
Pool size is 20; the TypeORM metadata table is typeorm_metadata.
The tables, by module
Table names come from each entity's @Entity({ name }). The main groups:
- catalogs —
products,product_articles(SKU / size / color variants),product_heads,product_types,product_subtypes,categories,sub_categories,brands,series,collaborations,tags,icons,color_codes,narratives,size_charts,product_on_sales,product_recommendations, and image/banner tables. - users —
members,member_addresses,member_carts,member_cart_items,member_cart_shipping_methods,stores, andref_countries/ref_provinces/ref_cities/ref_districts/ref_subdistricts. - orders —
orders,order_items,order_addresses. - deliveries —
deliveries. - promotions —
vouchers(+voucher_types,voucher_couriers,voucher_payment_methods, and per-kind child tables),discounts(+discount_types, tier/bundle/gift child tables),order_discounts,flash_sales,flash_sales_products. - journals —
journals,journal_categories,journal_tags,journal_products. - admins —
admins,roles,menus,roles_menus,departments,settings,promo_banners,highlight_subcategories.
Bilingual columns are common: nameId/nameEn, descId/descEn, metaTitleId/metaTitleEn.
Snapshots and live databases
- Local (Mac): Postgres at
localhost:5432, userpostgres, holding dated snapshotsexsport_prod_YYYYMMDDandexsport_dev_*. The backend.envDB_NAMEpicks one — read it, do not assume; it changes often (it wasexsport_dev_20250921on 2026-09-15). Prod snapshots are real production data. - Live: AWS RDS. Production is reached through the bastion
bastion.prod.exsport.bdt.dev. TablePlus hasexsport_dev/exsport_stg/exsport_prodconnections.