0085_snapshot.json 110 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009
  1. {
  2. "id": "70edcf0a-ce4e-4951-9ebf-d92e95632f7c",
  3. "prevId": "1d1ba01c-7adc-467e-bc9c-90abab9e5b92",
  4. "version": "7",
  5. "dialect": "postgresql",
  6. "tables": {
  7. "public.error_rules": {
  8. "name": "error_rules",
  9. "schema": "",
  10. "columns": {
  11. "id": {
  12. "name": "id",
  13. "type": "serial",
  14. "primaryKey": true,
  15. "notNull": true
  16. },
  17. "pattern": {
  18. "name": "pattern",
  19. "type": "text",
  20. "primaryKey": false,
  21. "notNull": true
  22. },
  23. "match_type": {
  24. "name": "match_type",
  25. "type": "varchar(20)",
  26. "primaryKey": false,
  27. "notNull": true,
  28. "default": "'regex'"
  29. },
  30. "category": {
  31. "name": "category",
  32. "type": "varchar(50)",
  33. "primaryKey": false,
  34. "notNull": true
  35. },
  36. "description": {
  37. "name": "description",
  38. "type": "text",
  39. "primaryKey": false,
  40. "notNull": false
  41. },
  42. "override_response": {
  43. "name": "override_response",
  44. "type": "jsonb",
  45. "primaryKey": false,
  46. "notNull": false
  47. },
  48. "override_status_code": {
  49. "name": "override_status_code",
  50. "type": "integer",
  51. "primaryKey": false,
  52. "notNull": false
  53. },
  54. "is_enabled": {
  55. "name": "is_enabled",
  56. "type": "boolean",
  57. "primaryKey": false,
  58. "notNull": true,
  59. "default": true
  60. },
  61. "is_default": {
  62. "name": "is_default",
  63. "type": "boolean",
  64. "primaryKey": false,
  65. "notNull": true,
  66. "default": false
  67. },
  68. "priority": {
  69. "name": "priority",
  70. "type": "integer",
  71. "primaryKey": false,
  72. "notNull": true,
  73. "default": 0
  74. },
  75. "created_at": {
  76. "name": "created_at",
  77. "type": "timestamp with time zone",
  78. "primaryKey": false,
  79. "notNull": false,
  80. "default": "now()"
  81. },
  82. "updated_at": {
  83. "name": "updated_at",
  84. "type": "timestamp with time zone",
  85. "primaryKey": false,
  86. "notNull": false,
  87. "default": "now()"
  88. }
  89. },
  90. "indexes": {
  91. "idx_error_rules_enabled": {
  92. "name": "idx_error_rules_enabled",
  93. "columns": [
  94. {
  95. "expression": "is_enabled",
  96. "isExpression": false,
  97. "asc": true,
  98. "nulls": "last"
  99. },
  100. {
  101. "expression": "priority",
  102. "isExpression": false,
  103. "asc": true,
  104. "nulls": "last"
  105. }
  106. ],
  107. "isUnique": false,
  108. "concurrently": false,
  109. "method": "btree",
  110. "with": {}
  111. },
  112. "unique_pattern": {
  113. "name": "unique_pattern",
  114. "columns": [
  115. {
  116. "expression": "pattern",
  117. "isExpression": false,
  118. "asc": true,
  119. "nulls": "last"
  120. }
  121. ],
  122. "isUnique": true,
  123. "concurrently": false,
  124. "method": "btree",
  125. "with": {}
  126. },
  127. "idx_category": {
  128. "name": "idx_category",
  129. "columns": [
  130. {
  131. "expression": "category",
  132. "isExpression": false,
  133. "asc": true,
  134. "nulls": "last"
  135. }
  136. ],
  137. "isUnique": false,
  138. "concurrently": false,
  139. "method": "btree",
  140. "with": {}
  141. },
  142. "idx_match_type": {
  143. "name": "idx_match_type",
  144. "columns": [
  145. {
  146. "expression": "match_type",
  147. "isExpression": false,
  148. "asc": true,
  149. "nulls": "last"
  150. }
  151. ],
  152. "isUnique": false,
  153. "concurrently": false,
  154. "method": "btree",
  155. "with": {}
  156. }
  157. },
  158. "foreignKeys": {},
  159. "compositePrimaryKeys": {},
  160. "uniqueConstraints": {},
  161. "policies": {},
  162. "checkConstraints": {},
  163. "isRLSEnabled": false
  164. },
  165. "public.keys": {
  166. "name": "keys",
  167. "schema": "",
  168. "columns": {
  169. "id": {
  170. "name": "id",
  171. "type": "serial",
  172. "primaryKey": true,
  173. "notNull": true
  174. },
  175. "user_id": {
  176. "name": "user_id",
  177. "type": "integer",
  178. "primaryKey": false,
  179. "notNull": true
  180. },
  181. "key": {
  182. "name": "key",
  183. "type": "varchar",
  184. "primaryKey": false,
  185. "notNull": true
  186. },
  187. "name": {
  188. "name": "name",
  189. "type": "varchar",
  190. "primaryKey": false,
  191. "notNull": true
  192. },
  193. "is_enabled": {
  194. "name": "is_enabled",
  195. "type": "boolean",
  196. "primaryKey": false,
  197. "notNull": false,
  198. "default": true
  199. },
  200. "expires_at": {
  201. "name": "expires_at",
  202. "type": "timestamp with time zone",
  203. "primaryKey": false,
  204. "notNull": false
  205. },
  206. "can_login_web_ui": {
  207. "name": "can_login_web_ui",
  208. "type": "boolean",
  209. "primaryKey": false,
  210. "notNull": false,
  211. "default": false
  212. },
  213. "limit_5h_usd": {
  214. "name": "limit_5h_usd",
  215. "type": "numeric(10, 2)",
  216. "primaryKey": false,
  217. "notNull": false
  218. },
  219. "limit_daily_usd": {
  220. "name": "limit_daily_usd",
  221. "type": "numeric(10, 2)",
  222. "primaryKey": false,
  223. "notNull": false
  224. },
  225. "daily_reset_mode": {
  226. "name": "daily_reset_mode",
  227. "type": "daily_reset_mode",
  228. "typeSchema": "public",
  229. "primaryKey": false,
  230. "notNull": true,
  231. "default": "'fixed'"
  232. },
  233. "daily_reset_time": {
  234. "name": "daily_reset_time",
  235. "type": "varchar(5)",
  236. "primaryKey": false,
  237. "notNull": true,
  238. "default": "'00:00'"
  239. },
  240. "limit_weekly_usd": {
  241. "name": "limit_weekly_usd",
  242. "type": "numeric(10, 2)",
  243. "primaryKey": false,
  244. "notNull": false
  245. },
  246. "limit_monthly_usd": {
  247. "name": "limit_monthly_usd",
  248. "type": "numeric(10, 2)",
  249. "primaryKey": false,
  250. "notNull": false
  251. },
  252. "limit_total_usd": {
  253. "name": "limit_total_usd",
  254. "type": "numeric(10, 2)",
  255. "primaryKey": false,
  256. "notNull": false
  257. },
  258. "cost_reset_at": {
  259. "name": "cost_reset_at",
  260. "type": "timestamp with time zone",
  261. "primaryKey": false,
  262. "notNull": false
  263. },
  264. "limit_concurrent_sessions": {
  265. "name": "limit_concurrent_sessions",
  266. "type": "integer",
  267. "primaryKey": false,
  268. "notNull": false,
  269. "default": 0
  270. },
  271. "provider_group": {
  272. "name": "provider_group",
  273. "type": "varchar(200)",
  274. "primaryKey": false,
  275. "notNull": false,
  276. "default": "'default'"
  277. },
  278. "cache_ttl_preference": {
  279. "name": "cache_ttl_preference",
  280. "type": "varchar(10)",
  281. "primaryKey": false,
  282. "notNull": false
  283. },
  284. "created_at": {
  285. "name": "created_at",
  286. "type": "timestamp with time zone",
  287. "primaryKey": false,
  288. "notNull": false,
  289. "default": "now()"
  290. },
  291. "updated_at": {
  292. "name": "updated_at",
  293. "type": "timestamp with time zone",
  294. "primaryKey": false,
  295. "notNull": false,
  296. "default": "now()"
  297. },
  298. "deleted_at": {
  299. "name": "deleted_at",
  300. "type": "timestamp with time zone",
  301. "primaryKey": false,
  302. "notNull": false
  303. }
  304. },
  305. "indexes": {
  306. "idx_keys_user_id": {
  307. "name": "idx_keys_user_id",
  308. "columns": [
  309. {
  310. "expression": "user_id",
  311. "isExpression": false,
  312. "asc": true,
  313. "nulls": "last"
  314. }
  315. ],
  316. "isUnique": false,
  317. "concurrently": false,
  318. "method": "btree",
  319. "with": {}
  320. },
  321. "idx_keys_key": {
  322. "name": "idx_keys_key",
  323. "columns": [
  324. {
  325. "expression": "key",
  326. "isExpression": false,
  327. "asc": true,
  328. "nulls": "last"
  329. }
  330. ],
  331. "isUnique": false,
  332. "concurrently": false,
  333. "method": "btree",
  334. "with": {}
  335. },
  336. "idx_keys_created_at": {
  337. "name": "idx_keys_created_at",
  338. "columns": [
  339. {
  340. "expression": "created_at",
  341. "isExpression": false,
  342. "asc": true,
  343. "nulls": "last"
  344. }
  345. ],
  346. "isUnique": false,
  347. "concurrently": false,
  348. "method": "btree",
  349. "with": {}
  350. },
  351. "idx_keys_deleted_at": {
  352. "name": "idx_keys_deleted_at",
  353. "columns": [
  354. {
  355. "expression": "deleted_at",
  356. "isExpression": false,
  357. "asc": true,
  358. "nulls": "last"
  359. }
  360. ],
  361. "isUnique": false,
  362. "concurrently": false,
  363. "method": "btree",
  364. "with": {}
  365. }
  366. },
  367. "foreignKeys": {},
  368. "compositePrimaryKeys": {},
  369. "uniqueConstraints": {},
  370. "policies": {},
  371. "checkConstraints": {},
  372. "isRLSEnabled": false
  373. },
  374. "public.message_request": {
  375. "name": "message_request",
  376. "schema": "",
  377. "columns": {
  378. "id": {
  379. "name": "id",
  380. "type": "serial",
  381. "primaryKey": true,
  382. "notNull": true
  383. },
  384. "provider_id": {
  385. "name": "provider_id",
  386. "type": "integer",
  387. "primaryKey": false,
  388. "notNull": true
  389. },
  390. "user_id": {
  391. "name": "user_id",
  392. "type": "integer",
  393. "primaryKey": false,
  394. "notNull": true
  395. },
  396. "key": {
  397. "name": "key",
  398. "type": "varchar",
  399. "primaryKey": false,
  400. "notNull": true
  401. },
  402. "model": {
  403. "name": "model",
  404. "type": "varchar(128)",
  405. "primaryKey": false,
  406. "notNull": false
  407. },
  408. "duration_ms": {
  409. "name": "duration_ms",
  410. "type": "integer",
  411. "primaryKey": false,
  412. "notNull": false
  413. },
  414. "cost_usd": {
  415. "name": "cost_usd",
  416. "type": "numeric(21, 15)",
  417. "primaryKey": false,
  418. "notNull": false,
  419. "default": "'0'"
  420. },
  421. "cost_multiplier": {
  422. "name": "cost_multiplier",
  423. "type": "numeric(10, 4)",
  424. "primaryKey": false,
  425. "notNull": false
  426. },
  427. "session_id": {
  428. "name": "session_id",
  429. "type": "varchar(64)",
  430. "primaryKey": false,
  431. "notNull": false
  432. },
  433. "request_sequence": {
  434. "name": "request_sequence",
  435. "type": "integer",
  436. "primaryKey": false,
  437. "notNull": false,
  438. "default": 1
  439. },
  440. "provider_chain": {
  441. "name": "provider_chain",
  442. "type": "jsonb",
  443. "primaryKey": false,
  444. "notNull": false
  445. },
  446. "status_code": {
  447. "name": "status_code",
  448. "type": "integer",
  449. "primaryKey": false,
  450. "notNull": false
  451. },
  452. "api_type": {
  453. "name": "api_type",
  454. "type": "varchar(20)",
  455. "primaryKey": false,
  456. "notNull": false
  457. },
  458. "endpoint": {
  459. "name": "endpoint",
  460. "type": "varchar(256)",
  461. "primaryKey": false,
  462. "notNull": false
  463. },
  464. "original_model": {
  465. "name": "original_model",
  466. "type": "varchar(128)",
  467. "primaryKey": false,
  468. "notNull": false
  469. },
  470. "input_tokens": {
  471. "name": "input_tokens",
  472. "type": "bigint",
  473. "primaryKey": false,
  474. "notNull": false
  475. },
  476. "output_tokens": {
  477. "name": "output_tokens",
  478. "type": "bigint",
  479. "primaryKey": false,
  480. "notNull": false
  481. },
  482. "ttfb_ms": {
  483. "name": "ttfb_ms",
  484. "type": "integer",
  485. "primaryKey": false,
  486. "notNull": false
  487. },
  488. "cache_creation_input_tokens": {
  489. "name": "cache_creation_input_tokens",
  490. "type": "bigint",
  491. "primaryKey": false,
  492. "notNull": false
  493. },
  494. "cache_read_input_tokens": {
  495. "name": "cache_read_input_tokens",
  496. "type": "bigint",
  497. "primaryKey": false,
  498. "notNull": false
  499. },
  500. "cache_creation_5m_input_tokens": {
  501. "name": "cache_creation_5m_input_tokens",
  502. "type": "bigint",
  503. "primaryKey": false,
  504. "notNull": false
  505. },
  506. "cache_creation_1h_input_tokens": {
  507. "name": "cache_creation_1h_input_tokens",
  508. "type": "bigint",
  509. "primaryKey": false,
  510. "notNull": false
  511. },
  512. "cache_ttl_applied": {
  513. "name": "cache_ttl_applied",
  514. "type": "varchar(10)",
  515. "primaryKey": false,
  516. "notNull": false
  517. },
  518. "context_1m_applied": {
  519. "name": "context_1m_applied",
  520. "type": "boolean",
  521. "primaryKey": false,
  522. "notNull": false,
  523. "default": false
  524. },
  525. "swap_cache_ttl_applied": {
  526. "name": "swap_cache_ttl_applied",
  527. "type": "boolean",
  528. "primaryKey": false,
  529. "notNull": false,
  530. "default": false
  531. },
  532. "special_settings": {
  533. "name": "special_settings",
  534. "type": "jsonb",
  535. "primaryKey": false,
  536. "notNull": false
  537. },
  538. "error_message": {
  539. "name": "error_message",
  540. "type": "text",
  541. "primaryKey": false,
  542. "notNull": false
  543. },
  544. "error_stack": {
  545. "name": "error_stack",
  546. "type": "text",
  547. "primaryKey": false,
  548. "notNull": false
  549. },
  550. "error_cause": {
  551. "name": "error_cause",
  552. "type": "text",
  553. "primaryKey": false,
  554. "notNull": false
  555. },
  556. "blocked_by": {
  557. "name": "blocked_by",
  558. "type": "varchar(50)",
  559. "primaryKey": false,
  560. "notNull": false
  561. },
  562. "blocked_reason": {
  563. "name": "blocked_reason",
  564. "type": "text",
  565. "primaryKey": false,
  566. "notNull": false
  567. },
  568. "user_agent": {
  569. "name": "user_agent",
  570. "type": "varchar(512)",
  571. "primaryKey": false,
  572. "notNull": false
  573. },
  574. "messages_count": {
  575. "name": "messages_count",
  576. "type": "integer",
  577. "primaryKey": false,
  578. "notNull": false
  579. },
  580. "created_at": {
  581. "name": "created_at",
  582. "type": "timestamp with time zone",
  583. "primaryKey": false,
  584. "notNull": false,
  585. "default": "now()"
  586. },
  587. "updated_at": {
  588. "name": "updated_at",
  589. "type": "timestamp with time zone",
  590. "primaryKey": false,
  591. "notNull": false,
  592. "default": "now()"
  593. },
  594. "deleted_at": {
  595. "name": "deleted_at",
  596. "type": "timestamp with time zone",
  597. "primaryKey": false,
  598. "notNull": false
  599. }
  600. },
  601. "indexes": {
  602. "idx_message_request_user_date_cost": {
  603. "name": "idx_message_request_user_date_cost",
  604. "columns": [
  605. {
  606. "expression": "user_id",
  607. "isExpression": false,
  608. "asc": true,
  609. "nulls": "last"
  610. },
  611. {
  612. "expression": "created_at",
  613. "isExpression": false,
  614. "asc": true,
  615. "nulls": "last"
  616. },
  617. {
  618. "expression": "cost_usd",
  619. "isExpression": false,
  620. "asc": true,
  621. "nulls": "last"
  622. }
  623. ],
  624. "isUnique": false,
  625. "where": "\"message_request\".\"deleted_at\" IS NULL",
  626. "concurrently": false,
  627. "method": "btree",
  628. "with": {}
  629. },
  630. "idx_message_request_user_created_at_cost_stats": {
  631. "name": "idx_message_request_user_created_at_cost_stats",
  632. "columns": [
  633. {
  634. "expression": "user_id",
  635. "isExpression": false,
  636. "asc": true,
  637. "nulls": "last"
  638. },
  639. {
  640. "expression": "created_at",
  641. "isExpression": false,
  642. "asc": true,
  643. "nulls": "last"
  644. },
  645. {
  646. "expression": "cost_usd",
  647. "isExpression": false,
  648. "asc": true,
  649. "nulls": "last"
  650. }
  651. ],
  652. "isUnique": false,
  653. "where": "\"message_request\".\"deleted_at\" IS NULL AND (\"message_request\".\"blocked_by\" IS NULL OR \"message_request\".\"blocked_by\" <> 'warmup')",
  654. "concurrently": false,
  655. "method": "btree",
  656. "with": {}
  657. },
  658. "idx_message_request_user_query": {
  659. "name": "idx_message_request_user_query",
  660. "columns": [
  661. {
  662. "expression": "user_id",
  663. "isExpression": false,
  664. "asc": true,
  665. "nulls": "last"
  666. },
  667. {
  668. "expression": "created_at",
  669. "isExpression": false,
  670. "asc": true,
  671. "nulls": "last"
  672. }
  673. ],
  674. "isUnique": false,
  675. "where": "\"message_request\".\"deleted_at\" IS NULL",
  676. "concurrently": false,
  677. "method": "btree",
  678. "with": {}
  679. },
  680. "idx_message_request_provider_created_at_active": {
  681. "name": "idx_message_request_provider_created_at_active",
  682. "columns": [
  683. {
  684. "expression": "provider_id",
  685. "isExpression": false,
  686. "asc": true,
  687. "nulls": "last"
  688. },
  689. {
  690. "expression": "created_at",
  691. "isExpression": false,
  692. "asc": true,
  693. "nulls": "last"
  694. }
  695. ],
  696. "isUnique": false,
  697. "where": "\"message_request\".\"deleted_at\" IS NULL AND (\"message_request\".\"blocked_by\" IS NULL OR \"message_request\".\"blocked_by\" <> 'warmup')",
  698. "concurrently": false,
  699. "method": "btree",
  700. "with": {}
  701. },
  702. "idx_message_request_session_id": {
  703. "name": "idx_message_request_session_id",
  704. "columns": [
  705. {
  706. "expression": "session_id",
  707. "isExpression": false,
  708. "asc": true,
  709. "nulls": "last"
  710. }
  711. ],
  712. "isUnique": false,
  713. "where": "\"message_request\".\"deleted_at\" IS NULL",
  714. "concurrently": false,
  715. "method": "btree",
  716. "with": {}
  717. },
  718. "idx_message_request_session_id_prefix": {
  719. "name": "idx_message_request_session_id_prefix",
  720. "columns": [
  721. {
  722. "expression": "\"session_id\" varchar_pattern_ops",
  723. "asc": true,
  724. "isExpression": true,
  725. "nulls": "last"
  726. }
  727. ],
  728. "isUnique": false,
  729. "where": "\"message_request\".\"deleted_at\" IS NULL AND (\"message_request\".\"blocked_by\" IS NULL OR \"message_request\".\"blocked_by\" <> 'warmup')",
  730. "concurrently": false,
  731. "method": "btree",
  732. "with": {}
  733. },
  734. "idx_message_request_session_seq": {
  735. "name": "idx_message_request_session_seq",
  736. "columns": [
  737. {
  738. "expression": "session_id",
  739. "isExpression": false,
  740. "asc": true,
  741. "nulls": "last"
  742. },
  743. {
  744. "expression": "request_sequence",
  745. "isExpression": false,
  746. "asc": true,
  747. "nulls": "last"
  748. }
  749. ],
  750. "isUnique": false,
  751. "where": "\"message_request\".\"deleted_at\" IS NULL",
  752. "concurrently": false,
  753. "method": "btree",
  754. "with": {}
  755. },
  756. "idx_message_request_endpoint": {
  757. "name": "idx_message_request_endpoint",
  758. "columns": [
  759. {
  760. "expression": "endpoint",
  761. "isExpression": false,
  762. "asc": true,
  763. "nulls": "last"
  764. }
  765. ],
  766. "isUnique": false,
  767. "where": "\"message_request\".\"deleted_at\" IS NULL",
  768. "concurrently": false,
  769. "method": "btree",
  770. "with": {}
  771. },
  772. "idx_message_request_blocked_by": {
  773. "name": "idx_message_request_blocked_by",
  774. "columns": [
  775. {
  776. "expression": "blocked_by",
  777. "isExpression": false,
  778. "asc": true,
  779. "nulls": "last"
  780. }
  781. ],
  782. "isUnique": false,
  783. "where": "\"message_request\".\"deleted_at\" IS NULL",
  784. "concurrently": false,
  785. "method": "btree",
  786. "with": {}
  787. },
  788. "idx_message_request_provider_id": {
  789. "name": "idx_message_request_provider_id",
  790. "columns": [
  791. {
  792. "expression": "provider_id",
  793. "isExpression": false,
  794. "asc": true,
  795. "nulls": "last"
  796. }
  797. ],
  798. "isUnique": false,
  799. "concurrently": false,
  800. "method": "btree",
  801. "with": {}
  802. },
  803. "idx_message_request_user_id": {
  804. "name": "idx_message_request_user_id",
  805. "columns": [
  806. {
  807. "expression": "user_id",
  808. "isExpression": false,
  809. "asc": true,
  810. "nulls": "last"
  811. }
  812. ],
  813. "isUnique": false,
  814. "concurrently": false,
  815. "method": "btree",
  816. "with": {}
  817. },
  818. "idx_message_request_key": {
  819. "name": "idx_message_request_key",
  820. "columns": [
  821. {
  822. "expression": "key",
  823. "isExpression": false,
  824. "asc": true,
  825. "nulls": "last"
  826. }
  827. ],
  828. "isUnique": false,
  829. "concurrently": false,
  830. "method": "btree",
  831. "with": {}
  832. },
  833. "idx_message_request_key_created_at_id": {
  834. "name": "idx_message_request_key_created_at_id",
  835. "columns": [
  836. {
  837. "expression": "key",
  838. "isExpression": false,
  839. "asc": true,
  840. "nulls": "last"
  841. },
  842. {
  843. "expression": "created_at",
  844. "isExpression": false,
  845. "asc": false,
  846. "nulls": "last"
  847. },
  848. {
  849. "expression": "id",
  850. "isExpression": false,
  851. "asc": false,
  852. "nulls": "last"
  853. }
  854. ],
  855. "isUnique": false,
  856. "where": "\"message_request\".\"deleted_at\" IS NULL",
  857. "concurrently": false,
  858. "method": "btree",
  859. "with": {}
  860. },
  861. "idx_message_request_key_model_active": {
  862. "name": "idx_message_request_key_model_active",
  863. "columns": [
  864. {
  865. "expression": "key",
  866. "isExpression": false,
  867. "asc": true,
  868. "nulls": "last"
  869. },
  870. {
  871. "expression": "model",
  872. "isExpression": false,
  873. "asc": true,
  874. "nulls": "last"
  875. }
  876. ],
  877. "isUnique": false,
  878. "where": "\"message_request\".\"deleted_at\" IS NULL AND \"message_request\".\"model\" IS NOT NULL AND (\"message_request\".\"blocked_by\" IS NULL OR \"message_request\".\"blocked_by\" <> 'warmup')",
  879. "concurrently": false,
  880. "method": "btree",
  881. "with": {}
  882. },
  883. "idx_message_request_key_endpoint_active": {
  884. "name": "idx_message_request_key_endpoint_active",
  885. "columns": [
  886. {
  887. "expression": "key",
  888. "isExpression": false,
  889. "asc": true,
  890. "nulls": "last"
  891. },
  892. {
  893. "expression": "endpoint",
  894. "isExpression": false,
  895. "asc": true,
  896. "nulls": "last"
  897. }
  898. ],
  899. "isUnique": false,
  900. "where": "\"message_request\".\"deleted_at\" IS NULL AND \"message_request\".\"endpoint\" IS NOT NULL AND (\"message_request\".\"blocked_by\" IS NULL OR \"message_request\".\"blocked_by\" <> 'warmup')",
  901. "concurrently": false,
  902. "method": "btree",
  903. "with": {}
  904. },
  905. "idx_message_request_created_at_id_active": {
  906. "name": "idx_message_request_created_at_id_active",
  907. "columns": [
  908. {
  909. "expression": "created_at",
  910. "isExpression": false,
  911. "asc": false,
  912. "nulls": "last"
  913. },
  914. {
  915. "expression": "id",
  916. "isExpression": false,
  917. "asc": false,
  918. "nulls": "last"
  919. }
  920. ],
  921. "isUnique": false,
  922. "where": "\"message_request\".\"deleted_at\" IS NULL",
  923. "concurrently": false,
  924. "method": "btree",
  925. "with": {}
  926. },
  927. "idx_message_request_model_active": {
  928. "name": "idx_message_request_model_active",
  929. "columns": [
  930. {
  931. "expression": "model",
  932. "isExpression": false,
  933. "asc": true,
  934. "nulls": "last"
  935. }
  936. ],
  937. "isUnique": false,
  938. "where": "\"message_request\".\"deleted_at\" IS NULL AND \"message_request\".\"model\" IS NOT NULL",
  939. "concurrently": false,
  940. "method": "btree",
  941. "with": {}
  942. },
  943. "idx_message_request_status_code_active": {
  944. "name": "idx_message_request_status_code_active",
  945. "columns": [
  946. {
  947. "expression": "status_code",
  948. "isExpression": false,
  949. "asc": true,
  950. "nulls": "last"
  951. }
  952. ],
  953. "isUnique": false,
  954. "where": "\"message_request\".\"deleted_at\" IS NULL AND \"message_request\".\"status_code\" IS NOT NULL",
  955. "concurrently": false,
  956. "method": "btree",
  957. "with": {}
  958. },
  959. "idx_message_request_created_at": {
  960. "name": "idx_message_request_created_at",
  961. "columns": [
  962. {
  963. "expression": "created_at",
  964. "isExpression": false,
  965. "asc": true,
  966. "nulls": "last"
  967. }
  968. ],
  969. "isUnique": false,
  970. "concurrently": false,
  971. "method": "btree",
  972. "with": {}
  973. },
  974. "idx_message_request_deleted_at": {
  975. "name": "idx_message_request_deleted_at",
  976. "columns": [
  977. {
  978. "expression": "deleted_at",
  979. "isExpression": false,
  980. "asc": true,
  981. "nulls": "last"
  982. }
  983. ],
  984. "isUnique": false,
  985. "concurrently": false,
  986. "method": "btree",
  987. "with": {}
  988. },
  989. "idx_message_request_key_last_active": {
  990. "name": "idx_message_request_key_last_active",
  991. "columns": [
  992. {
  993. "expression": "key",
  994. "isExpression": false,
  995. "asc": true,
  996. "nulls": "last"
  997. },
  998. {
  999. "expression": "created_at",
  1000. "isExpression": false,
  1001. "asc": false,
  1002. "nulls": "last"
  1003. }
  1004. ],
  1005. "isUnique": false,
  1006. "where": "\"message_request\".\"deleted_at\" IS NULL AND (\"message_request\".\"blocked_by\" IS NULL OR \"message_request\".\"blocked_by\" <> 'warmup')",
  1007. "concurrently": false,
  1008. "method": "btree",
  1009. "with": {}
  1010. },
  1011. "idx_message_request_key_cost_active": {
  1012. "name": "idx_message_request_key_cost_active",
  1013. "columns": [
  1014. {
  1015. "expression": "key",
  1016. "isExpression": false,
  1017. "asc": true,
  1018. "nulls": "last"
  1019. },
  1020. {
  1021. "expression": "cost_usd",
  1022. "isExpression": false,
  1023. "asc": true,
  1024. "nulls": "last"
  1025. }
  1026. ],
  1027. "isUnique": false,
  1028. "where": "\"message_request\".\"deleted_at\" IS NULL AND (\"message_request\".\"blocked_by\" IS NULL OR \"message_request\".\"blocked_by\" <> 'warmup')",
  1029. "concurrently": false,
  1030. "method": "btree",
  1031. "with": {}
  1032. },
  1033. "idx_message_request_session_user_info": {
  1034. "name": "idx_message_request_session_user_info",
  1035. "columns": [
  1036. {
  1037. "expression": "session_id",
  1038. "isExpression": false,
  1039. "asc": true,
  1040. "nulls": "last"
  1041. },
  1042. {
  1043. "expression": "created_at",
  1044. "isExpression": false,
  1045. "asc": true,
  1046. "nulls": "last"
  1047. },
  1048. {
  1049. "expression": "user_id",
  1050. "isExpression": false,
  1051. "asc": true,
  1052. "nulls": "last"
  1053. },
  1054. {
  1055. "expression": "key",
  1056. "isExpression": false,
  1057. "asc": true,
  1058. "nulls": "last"
  1059. }
  1060. ],
  1061. "isUnique": false,
  1062. "where": "\"message_request\".\"deleted_at\" IS NULL",
  1063. "concurrently": false,
  1064. "method": "btree",
  1065. "with": {}
  1066. }
  1067. },
  1068. "foreignKeys": {},
  1069. "compositePrimaryKeys": {},
  1070. "uniqueConstraints": {},
  1071. "policies": {},
  1072. "checkConstraints": {},
  1073. "isRLSEnabled": false
  1074. },
  1075. "public.model_prices": {
  1076. "name": "model_prices",
  1077. "schema": "",
  1078. "columns": {
  1079. "id": {
  1080. "name": "id",
  1081. "type": "serial",
  1082. "primaryKey": true,
  1083. "notNull": true
  1084. },
  1085. "model_name": {
  1086. "name": "model_name",
  1087. "type": "varchar",
  1088. "primaryKey": false,
  1089. "notNull": true
  1090. },
  1091. "price_data": {
  1092. "name": "price_data",
  1093. "type": "jsonb",
  1094. "primaryKey": false,
  1095. "notNull": true
  1096. },
  1097. "source": {
  1098. "name": "source",
  1099. "type": "varchar(20)",
  1100. "primaryKey": false,
  1101. "notNull": true,
  1102. "default": "'litellm'"
  1103. },
  1104. "created_at": {
  1105. "name": "created_at",
  1106. "type": "timestamp with time zone",
  1107. "primaryKey": false,
  1108. "notNull": false,
  1109. "default": "now()"
  1110. },
  1111. "updated_at": {
  1112. "name": "updated_at",
  1113. "type": "timestamp with time zone",
  1114. "primaryKey": false,
  1115. "notNull": false,
  1116. "default": "now()"
  1117. }
  1118. },
  1119. "indexes": {
  1120. "idx_model_prices_latest": {
  1121. "name": "idx_model_prices_latest",
  1122. "columns": [
  1123. {
  1124. "expression": "model_name",
  1125. "isExpression": false,
  1126. "asc": true,
  1127. "nulls": "last"
  1128. },
  1129. {
  1130. "expression": "created_at",
  1131. "isExpression": false,
  1132. "asc": false,
  1133. "nulls": "last"
  1134. }
  1135. ],
  1136. "isUnique": false,
  1137. "concurrently": false,
  1138. "method": "btree",
  1139. "with": {}
  1140. },
  1141. "idx_model_prices_model_name": {
  1142. "name": "idx_model_prices_model_name",
  1143. "columns": [
  1144. {
  1145. "expression": "model_name",
  1146. "isExpression": false,
  1147. "asc": true,
  1148. "nulls": "last"
  1149. }
  1150. ],
  1151. "isUnique": false,
  1152. "concurrently": false,
  1153. "method": "btree",
  1154. "with": {}
  1155. },
  1156. "idx_model_prices_created_at": {
  1157. "name": "idx_model_prices_created_at",
  1158. "columns": [
  1159. {
  1160. "expression": "created_at",
  1161. "isExpression": false,
  1162. "asc": false,
  1163. "nulls": "last"
  1164. }
  1165. ],
  1166. "isUnique": false,
  1167. "concurrently": false,
  1168. "method": "btree",
  1169. "with": {}
  1170. },
  1171. "idx_model_prices_source": {
  1172. "name": "idx_model_prices_source",
  1173. "columns": [
  1174. {
  1175. "expression": "source",
  1176. "isExpression": false,
  1177. "asc": true,
  1178. "nulls": "last"
  1179. }
  1180. ],
  1181. "isUnique": false,
  1182. "concurrently": false,
  1183. "method": "btree",
  1184. "with": {}
  1185. }
  1186. },
  1187. "foreignKeys": {},
  1188. "compositePrimaryKeys": {},
  1189. "uniqueConstraints": {},
  1190. "policies": {},
  1191. "checkConstraints": {},
  1192. "isRLSEnabled": false
  1193. },
  1194. "public.notification_settings": {
  1195. "name": "notification_settings",
  1196. "schema": "",
  1197. "columns": {
  1198. "id": {
  1199. "name": "id",
  1200. "type": "serial",
  1201. "primaryKey": true,
  1202. "notNull": true
  1203. },
  1204. "enabled": {
  1205. "name": "enabled",
  1206. "type": "boolean",
  1207. "primaryKey": false,
  1208. "notNull": true,
  1209. "default": false
  1210. },
  1211. "use_legacy_mode": {
  1212. "name": "use_legacy_mode",
  1213. "type": "boolean",
  1214. "primaryKey": false,
  1215. "notNull": true,
  1216. "default": false
  1217. },
  1218. "circuit_breaker_enabled": {
  1219. "name": "circuit_breaker_enabled",
  1220. "type": "boolean",
  1221. "primaryKey": false,
  1222. "notNull": true,
  1223. "default": false
  1224. },
  1225. "circuit_breaker_webhook": {
  1226. "name": "circuit_breaker_webhook",
  1227. "type": "varchar(512)",
  1228. "primaryKey": false,
  1229. "notNull": false
  1230. },
  1231. "daily_leaderboard_enabled": {
  1232. "name": "daily_leaderboard_enabled",
  1233. "type": "boolean",
  1234. "primaryKey": false,
  1235. "notNull": true,
  1236. "default": false
  1237. },
  1238. "daily_leaderboard_webhook": {
  1239. "name": "daily_leaderboard_webhook",
  1240. "type": "varchar(512)",
  1241. "primaryKey": false,
  1242. "notNull": false
  1243. },
  1244. "daily_leaderboard_time": {
  1245. "name": "daily_leaderboard_time",
  1246. "type": "varchar(10)",
  1247. "primaryKey": false,
  1248. "notNull": false,
  1249. "default": "'09:00'"
  1250. },
  1251. "daily_leaderboard_top_n": {
  1252. "name": "daily_leaderboard_top_n",
  1253. "type": "integer",
  1254. "primaryKey": false,
  1255. "notNull": false,
  1256. "default": 5
  1257. },
  1258. "cost_alert_enabled": {
  1259. "name": "cost_alert_enabled",
  1260. "type": "boolean",
  1261. "primaryKey": false,
  1262. "notNull": true,
  1263. "default": false
  1264. },
  1265. "cost_alert_webhook": {
  1266. "name": "cost_alert_webhook",
  1267. "type": "varchar(512)",
  1268. "primaryKey": false,
  1269. "notNull": false
  1270. },
  1271. "cost_alert_threshold": {
  1272. "name": "cost_alert_threshold",
  1273. "type": "numeric(5, 2)",
  1274. "primaryKey": false,
  1275. "notNull": false,
  1276. "default": "'0.80'"
  1277. },
  1278. "cost_alert_check_interval": {
  1279. "name": "cost_alert_check_interval",
  1280. "type": "integer",
  1281. "primaryKey": false,
  1282. "notNull": false,
  1283. "default": 60
  1284. },
  1285. "cache_hit_rate_alert_enabled": {
  1286. "name": "cache_hit_rate_alert_enabled",
  1287. "type": "boolean",
  1288. "primaryKey": false,
  1289. "notNull": true,
  1290. "default": false
  1291. },
  1292. "cache_hit_rate_alert_webhook": {
  1293. "name": "cache_hit_rate_alert_webhook",
  1294. "type": "varchar(512)",
  1295. "primaryKey": false,
  1296. "notNull": false
  1297. },
  1298. "cache_hit_rate_alert_window_mode": {
  1299. "name": "cache_hit_rate_alert_window_mode",
  1300. "type": "varchar(10)",
  1301. "primaryKey": false,
  1302. "notNull": false,
  1303. "default": "'auto'"
  1304. },
  1305. "cache_hit_rate_alert_check_interval": {
  1306. "name": "cache_hit_rate_alert_check_interval",
  1307. "type": "integer",
  1308. "primaryKey": false,
  1309. "notNull": false,
  1310. "default": 5
  1311. },
  1312. "cache_hit_rate_alert_historical_lookback_days": {
  1313. "name": "cache_hit_rate_alert_historical_lookback_days",
  1314. "type": "integer",
  1315. "primaryKey": false,
  1316. "notNull": false,
  1317. "default": 7
  1318. },
  1319. "cache_hit_rate_alert_min_eligible_requests": {
  1320. "name": "cache_hit_rate_alert_min_eligible_requests",
  1321. "type": "integer",
  1322. "primaryKey": false,
  1323. "notNull": false,
  1324. "default": 20
  1325. },
  1326. "cache_hit_rate_alert_min_eligible_tokens": {
  1327. "name": "cache_hit_rate_alert_min_eligible_tokens",
  1328. "type": "integer",
  1329. "primaryKey": false,
  1330. "notNull": false,
  1331. "default": 0
  1332. },
  1333. "cache_hit_rate_alert_abs_min": {
  1334. "name": "cache_hit_rate_alert_abs_min",
  1335. "type": "numeric(5, 4)",
  1336. "primaryKey": false,
  1337. "notNull": false,
  1338. "default": "'0.05'"
  1339. },
  1340. "cache_hit_rate_alert_drop_rel": {
  1341. "name": "cache_hit_rate_alert_drop_rel",
  1342. "type": "numeric(5, 4)",
  1343. "primaryKey": false,
  1344. "notNull": false,
  1345. "default": "'0.3'"
  1346. },
  1347. "cache_hit_rate_alert_drop_abs": {
  1348. "name": "cache_hit_rate_alert_drop_abs",
  1349. "type": "numeric(5, 4)",
  1350. "primaryKey": false,
  1351. "notNull": false,
  1352. "default": "'0.1'"
  1353. },
  1354. "cache_hit_rate_alert_cooldown_minutes": {
  1355. "name": "cache_hit_rate_alert_cooldown_minutes",
  1356. "type": "integer",
  1357. "primaryKey": false,
  1358. "notNull": false,
  1359. "default": 30
  1360. },
  1361. "cache_hit_rate_alert_top_n": {
  1362. "name": "cache_hit_rate_alert_top_n",
  1363. "type": "integer",
  1364. "primaryKey": false,
  1365. "notNull": false,
  1366. "default": 10
  1367. },
  1368. "created_at": {
  1369. "name": "created_at",
  1370. "type": "timestamp with time zone",
  1371. "primaryKey": false,
  1372. "notNull": false,
  1373. "default": "now()"
  1374. },
  1375. "updated_at": {
  1376. "name": "updated_at",
  1377. "type": "timestamp with time zone",
  1378. "primaryKey": false,
  1379. "notNull": false,
  1380. "default": "now()"
  1381. }
  1382. },
  1383. "indexes": {},
  1384. "foreignKeys": {},
  1385. "compositePrimaryKeys": {},
  1386. "uniqueConstraints": {},
  1387. "policies": {},
  1388. "checkConstraints": {},
  1389. "isRLSEnabled": false
  1390. },
  1391. "public.notification_target_bindings": {
  1392. "name": "notification_target_bindings",
  1393. "schema": "",
  1394. "columns": {
  1395. "id": {
  1396. "name": "id",
  1397. "type": "serial",
  1398. "primaryKey": true,
  1399. "notNull": true
  1400. },
  1401. "notification_type": {
  1402. "name": "notification_type",
  1403. "type": "notification_type",
  1404. "typeSchema": "public",
  1405. "primaryKey": false,
  1406. "notNull": true
  1407. },
  1408. "target_id": {
  1409. "name": "target_id",
  1410. "type": "integer",
  1411. "primaryKey": false,
  1412. "notNull": true
  1413. },
  1414. "is_enabled": {
  1415. "name": "is_enabled",
  1416. "type": "boolean",
  1417. "primaryKey": false,
  1418. "notNull": true,
  1419. "default": true
  1420. },
  1421. "schedule_cron": {
  1422. "name": "schedule_cron",
  1423. "type": "varchar(100)",
  1424. "primaryKey": false,
  1425. "notNull": false
  1426. },
  1427. "schedule_timezone": {
  1428. "name": "schedule_timezone",
  1429. "type": "varchar(50)",
  1430. "primaryKey": false,
  1431. "notNull": false
  1432. },
  1433. "template_override": {
  1434. "name": "template_override",
  1435. "type": "jsonb",
  1436. "primaryKey": false,
  1437. "notNull": false
  1438. },
  1439. "created_at": {
  1440. "name": "created_at",
  1441. "type": "timestamp with time zone",
  1442. "primaryKey": false,
  1443. "notNull": false,
  1444. "default": "now()"
  1445. }
  1446. },
  1447. "indexes": {
  1448. "unique_notification_target_binding": {
  1449. "name": "unique_notification_target_binding",
  1450. "columns": [
  1451. {
  1452. "expression": "notification_type",
  1453. "isExpression": false,
  1454. "asc": true,
  1455. "nulls": "last"
  1456. },
  1457. {
  1458. "expression": "target_id",
  1459. "isExpression": false,
  1460. "asc": true,
  1461. "nulls": "last"
  1462. }
  1463. ],
  1464. "isUnique": true,
  1465. "concurrently": false,
  1466. "method": "btree",
  1467. "with": {}
  1468. },
  1469. "idx_notification_bindings_type": {
  1470. "name": "idx_notification_bindings_type",
  1471. "columns": [
  1472. {
  1473. "expression": "notification_type",
  1474. "isExpression": false,
  1475. "asc": true,
  1476. "nulls": "last"
  1477. },
  1478. {
  1479. "expression": "is_enabled",
  1480. "isExpression": false,
  1481. "asc": true,
  1482. "nulls": "last"
  1483. }
  1484. ],
  1485. "isUnique": false,
  1486. "concurrently": false,
  1487. "method": "btree",
  1488. "with": {}
  1489. },
  1490. "idx_notification_bindings_target": {
  1491. "name": "idx_notification_bindings_target",
  1492. "columns": [
  1493. {
  1494. "expression": "target_id",
  1495. "isExpression": false,
  1496. "asc": true,
  1497. "nulls": "last"
  1498. },
  1499. {
  1500. "expression": "is_enabled",
  1501. "isExpression": false,
  1502. "asc": true,
  1503. "nulls": "last"
  1504. }
  1505. ],
  1506. "isUnique": false,
  1507. "concurrently": false,
  1508. "method": "btree",
  1509. "with": {}
  1510. }
  1511. },
  1512. "foreignKeys": {
  1513. "notification_target_bindings_target_id_webhook_targets_id_fk": {
  1514. "name": "notification_target_bindings_target_id_webhook_targets_id_fk",
  1515. "tableFrom": "notification_target_bindings",
  1516. "tableTo": "webhook_targets",
  1517. "columnsFrom": [
  1518. "target_id"
  1519. ],
  1520. "columnsTo": [
  1521. "id"
  1522. ],
  1523. "onDelete": "cascade",
  1524. "onUpdate": "no action"
  1525. }
  1526. },
  1527. "compositePrimaryKeys": {},
  1528. "uniqueConstraints": {},
  1529. "policies": {},
  1530. "checkConstraints": {},
  1531. "isRLSEnabled": false
  1532. },
  1533. "public.provider_endpoint_probe_logs": {
  1534. "name": "provider_endpoint_probe_logs",
  1535. "schema": "",
  1536. "columns": {
  1537. "id": {
  1538. "name": "id",
  1539. "type": "serial",
  1540. "primaryKey": true,
  1541. "notNull": true
  1542. },
  1543. "endpoint_id": {
  1544. "name": "endpoint_id",
  1545. "type": "integer",
  1546. "primaryKey": false,
  1547. "notNull": true
  1548. },
  1549. "source": {
  1550. "name": "source",
  1551. "type": "varchar(20)",
  1552. "primaryKey": false,
  1553. "notNull": true,
  1554. "default": "'scheduled'"
  1555. },
  1556. "ok": {
  1557. "name": "ok",
  1558. "type": "boolean",
  1559. "primaryKey": false,
  1560. "notNull": true
  1561. },
  1562. "status_code": {
  1563. "name": "status_code",
  1564. "type": "integer",
  1565. "primaryKey": false,
  1566. "notNull": false
  1567. },
  1568. "latency_ms": {
  1569. "name": "latency_ms",
  1570. "type": "integer",
  1571. "primaryKey": false,
  1572. "notNull": false
  1573. },
  1574. "error_type": {
  1575. "name": "error_type",
  1576. "type": "varchar(64)",
  1577. "primaryKey": false,
  1578. "notNull": false
  1579. },
  1580. "error_message": {
  1581. "name": "error_message",
  1582. "type": "text",
  1583. "primaryKey": false,
  1584. "notNull": false
  1585. },
  1586. "created_at": {
  1587. "name": "created_at",
  1588. "type": "timestamp with time zone",
  1589. "primaryKey": false,
  1590. "notNull": false,
  1591. "default": "now()"
  1592. }
  1593. },
  1594. "indexes": {
  1595. "idx_provider_endpoint_probe_logs_endpoint_created_at": {
  1596. "name": "idx_provider_endpoint_probe_logs_endpoint_created_at",
  1597. "columns": [
  1598. {
  1599. "expression": "endpoint_id",
  1600. "isExpression": false,
  1601. "asc": true,
  1602. "nulls": "last"
  1603. },
  1604. {
  1605. "expression": "created_at",
  1606. "isExpression": false,
  1607. "asc": false,
  1608. "nulls": "last"
  1609. }
  1610. ],
  1611. "isUnique": false,
  1612. "concurrently": false,
  1613. "method": "btree",
  1614. "with": {}
  1615. },
  1616. "idx_provider_endpoint_probe_logs_created_at": {
  1617. "name": "idx_provider_endpoint_probe_logs_created_at",
  1618. "columns": [
  1619. {
  1620. "expression": "created_at",
  1621. "isExpression": false,
  1622. "asc": true,
  1623. "nulls": "last"
  1624. }
  1625. ],
  1626. "isUnique": false,
  1627. "concurrently": false,
  1628. "method": "btree",
  1629. "with": {}
  1630. }
  1631. },
  1632. "foreignKeys": {
  1633. "provider_endpoint_probe_logs_endpoint_id_provider_endpoints_id_fk": {
  1634. "name": "provider_endpoint_probe_logs_endpoint_id_provider_endpoints_id_fk",
  1635. "tableFrom": "provider_endpoint_probe_logs",
  1636. "tableTo": "provider_endpoints",
  1637. "columnsFrom": [
  1638. "endpoint_id"
  1639. ],
  1640. "columnsTo": [
  1641. "id"
  1642. ],
  1643. "onDelete": "cascade",
  1644. "onUpdate": "no action"
  1645. }
  1646. },
  1647. "compositePrimaryKeys": {},
  1648. "uniqueConstraints": {},
  1649. "policies": {},
  1650. "checkConstraints": {},
  1651. "isRLSEnabled": false
  1652. },
  1653. "public.provider_endpoints": {
  1654. "name": "provider_endpoints",
  1655. "schema": "",
  1656. "columns": {
  1657. "id": {
  1658. "name": "id",
  1659. "type": "serial",
  1660. "primaryKey": true,
  1661. "notNull": true
  1662. },
  1663. "vendor_id": {
  1664. "name": "vendor_id",
  1665. "type": "integer",
  1666. "primaryKey": false,
  1667. "notNull": true
  1668. },
  1669. "provider_type": {
  1670. "name": "provider_type",
  1671. "type": "varchar(20)",
  1672. "primaryKey": false,
  1673. "notNull": true,
  1674. "default": "'claude'"
  1675. },
  1676. "url": {
  1677. "name": "url",
  1678. "type": "text",
  1679. "primaryKey": false,
  1680. "notNull": true
  1681. },
  1682. "label": {
  1683. "name": "label",
  1684. "type": "varchar(200)",
  1685. "primaryKey": false,
  1686. "notNull": false
  1687. },
  1688. "sort_order": {
  1689. "name": "sort_order",
  1690. "type": "integer",
  1691. "primaryKey": false,
  1692. "notNull": true,
  1693. "default": 0
  1694. },
  1695. "is_enabled": {
  1696. "name": "is_enabled",
  1697. "type": "boolean",
  1698. "primaryKey": false,
  1699. "notNull": true,
  1700. "default": true
  1701. },
  1702. "last_probed_at": {
  1703. "name": "last_probed_at",
  1704. "type": "timestamp with time zone",
  1705. "primaryKey": false,
  1706. "notNull": false
  1707. },
  1708. "last_probe_ok": {
  1709. "name": "last_probe_ok",
  1710. "type": "boolean",
  1711. "primaryKey": false,
  1712. "notNull": false
  1713. },
  1714. "last_probe_status_code": {
  1715. "name": "last_probe_status_code",
  1716. "type": "integer",
  1717. "primaryKey": false,
  1718. "notNull": false
  1719. },
  1720. "last_probe_latency_ms": {
  1721. "name": "last_probe_latency_ms",
  1722. "type": "integer",
  1723. "primaryKey": false,
  1724. "notNull": false
  1725. },
  1726. "last_probe_error_type": {
  1727. "name": "last_probe_error_type",
  1728. "type": "varchar(64)",
  1729. "primaryKey": false,
  1730. "notNull": false
  1731. },
  1732. "last_probe_error_message": {
  1733. "name": "last_probe_error_message",
  1734. "type": "text",
  1735. "primaryKey": false,
  1736. "notNull": false
  1737. },
  1738. "created_at": {
  1739. "name": "created_at",
  1740. "type": "timestamp with time zone",
  1741. "primaryKey": false,
  1742. "notNull": false,
  1743. "default": "now()"
  1744. },
  1745. "updated_at": {
  1746. "name": "updated_at",
  1747. "type": "timestamp with time zone",
  1748. "primaryKey": false,
  1749. "notNull": false,
  1750. "default": "now()"
  1751. },
  1752. "deleted_at": {
  1753. "name": "deleted_at",
  1754. "type": "timestamp with time zone",
  1755. "primaryKey": false,
  1756. "notNull": false
  1757. }
  1758. },
  1759. "indexes": {
  1760. "uniq_provider_endpoints_vendor_type_url": {
  1761. "name": "uniq_provider_endpoints_vendor_type_url",
  1762. "columns": [
  1763. {
  1764. "expression": "vendor_id",
  1765. "isExpression": false,
  1766. "asc": true,
  1767. "nulls": "last"
  1768. },
  1769. {
  1770. "expression": "provider_type",
  1771. "isExpression": false,
  1772. "asc": true,
  1773. "nulls": "last"
  1774. },
  1775. {
  1776. "expression": "url",
  1777. "isExpression": false,
  1778. "asc": true,
  1779. "nulls": "last"
  1780. }
  1781. ],
  1782. "isUnique": true,
  1783. "where": "\"provider_endpoints\".\"deleted_at\" IS NULL",
  1784. "concurrently": false,
  1785. "method": "btree",
  1786. "with": {}
  1787. },
  1788. "idx_provider_endpoints_vendor_type": {
  1789. "name": "idx_provider_endpoints_vendor_type",
  1790. "columns": [
  1791. {
  1792. "expression": "vendor_id",
  1793. "isExpression": false,
  1794. "asc": true,
  1795. "nulls": "last"
  1796. },
  1797. {
  1798. "expression": "provider_type",
  1799. "isExpression": false,
  1800. "asc": true,
  1801. "nulls": "last"
  1802. }
  1803. ],
  1804. "isUnique": false,
  1805. "where": "\"provider_endpoints\".\"deleted_at\" IS NULL",
  1806. "concurrently": false,
  1807. "method": "btree",
  1808. "with": {}
  1809. },
  1810. "idx_provider_endpoints_enabled": {
  1811. "name": "idx_provider_endpoints_enabled",
  1812. "columns": [
  1813. {
  1814. "expression": "is_enabled",
  1815. "isExpression": false,
  1816. "asc": true,
  1817. "nulls": "last"
  1818. },
  1819. {
  1820. "expression": "vendor_id",
  1821. "isExpression": false,
  1822. "asc": true,
  1823. "nulls": "last"
  1824. },
  1825. {
  1826. "expression": "provider_type",
  1827. "isExpression": false,
  1828. "asc": true,
  1829. "nulls": "last"
  1830. }
  1831. ],
  1832. "isUnique": false,
  1833. "where": "\"provider_endpoints\".\"deleted_at\" IS NULL",
  1834. "concurrently": false,
  1835. "method": "btree",
  1836. "with": {}
  1837. },
  1838. "idx_provider_endpoints_pick_enabled": {
  1839. "name": "idx_provider_endpoints_pick_enabled",
  1840. "columns": [
  1841. {
  1842. "expression": "vendor_id",
  1843. "isExpression": false,
  1844. "asc": true,
  1845. "nulls": "last"
  1846. },
  1847. {
  1848. "expression": "provider_type",
  1849. "isExpression": false,
  1850. "asc": true,
  1851. "nulls": "last"
  1852. },
  1853. {
  1854. "expression": "is_enabled",
  1855. "isExpression": false,
  1856. "asc": true,
  1857. "nulls": "last"
  1858. },
  1859. {
  1860. "expression": "sort_order",
  1861. "isExpression": false,
  1862. "asc": true,
  1863. "nulls": "last"
  1864. },
  1865. {
  1866. "expression": "id",
  1867. "isExpression": false,
  1868. "asc": true,
  1869. "nulls": "last"
  1870. }
  1871. ],
  1872. "isUnique": false,
  1873. "where": "\"provider_endpoints\".\"deleted_at\" IS NULL",
  1874. "concurrently": false,
  1875. "method": "btree",
  1876. "with": {}
  1877. },
  1878. "idx_provider_endpoints_created_at": {
  1879. "name": "idx_provider_endpoints_created_at",
  1880. "columns": [
  1881. {
  1882. "expression": "created_at",
  1883. "isExpression": false,
  1884. "asc": true,
  1885. "nulls": "last"
  1886. }
  1887. ],
  1888. "isUnique": false,
  1889. "concurrently": false,
  1890. "method": "btree",
  1891. "with": {}
  1892. },
  1893. "idx_provider_endpoints_deleted_at": {
  1894. "name": "idx_provider_endpoints_deleted_at",
  1895. "columns": [
  1896. {
  1897. "expression": "deleted_at",
  1898. "isExpression": false,
  1899. "asc": true,
  1900. "nulls": "last"
  1901. }
  1902. ],
  1903. "isUnique": false,
  1904. "concurrently": false,
  1905. "method": "btree",
  1906. "with": {}
  1907. }
  1908. },
  1909. "foreignKeys": {
  1910. "provider_endpoints_vendor_id_provider_vendors_id_fk": {
  1911. "name": "provider_endpoints_vendor_id_provider_vendors_id_fk",
  1912. "tableFrom": "provider_endpoints",
  1913. "tableTo": "provider_vendors",
  1914. "columnsFrom": [
  1915. "vendor_id"
  1916. ],
  1917. "columnsTo": [
  1918. "id"
  1919. ],
  1920. "onDelete": "cascade",
  1921. "onUpdate": "no action"
  1922. }
  1923. },
  1924. "compositePrimaryKeys": {},
  1925. "uniqueConstraints": {},
  1926. "policies": {},
  1927. "checkConstraints": {},
  1928. "isRLSEnabled": false
  1929. },
  1930. "public.provider_vendors": {
  1931. "name": "provider_vendors",
  1932. "schema": "",
  1933. "columns": {
  1934. "id": {
  1935. "name": "id",
  1936. "type": "serial",
  1937. "primaryKey": true,
  1938. "notNull": true
  1939. },
  1940. "website_domain": {
  1941. "name": "website_domain",
  1942. "type": "varchar(255)",
  1943. "primaryKey": false,
  1944. "notNull": true
  1945. },
  1946. "display_name": {
  1947. "name": "display_name",
  1948. "type": "varchar(200)",
  1949. "primaryKey": false,
  1950. "notNull": false
  1951. },
  1952. "website_url": {
  1953. "name": "website_url",
  1954. "type": "text",
  1955. "primaryKey": false,
  1956. "notNull": false
  1957. },
  1958. "favicon_url": {
  1959. "name": "favicon_url",
  1960. "type": "text",
  1961. "primaryKey": false,
  1962. "notNull": false
  1963. },
  1964. "created_at": {
  1965. "name": "created_at",
  1966. "type": "timestamp with time zone",
  1967. "primaryKey": false,
  1968. "notNull": false,
  1969. "default": "now()"
  1970. },
  1971. "updated_at": {
  1972. "name": "updated_at",
  1973. "type": "timestamp with time zone",
  1974. "primaryKey": false,
  1975. "notNull": false,
  1976. "default": "now()"
  1977. }
  1978. },
  1979. "indexes": {
  1980. "uniq_provider_vendors_website_domain": {
  1981. "name": "uniq_provider_vendors_website_domain",
  1982. "columns": [
  1983. {
  1984. "expression": "website_domain",
  1985. "isExpression": false,
  1986. "asc": true,
  1987. "nulls": "last"
  1988. }
  1989. ],
  1990. "isUnique": true,
  1991. "concurrently": false,
  1992. "method": "btree",
  1993. "with": {}
  1994. },
  1995. "idx_provider_vendors_created_at": {
  1996. "name": "idx_provider_vendors_created_at",
  1997. "columns": [
  1998. {
  1999. "expression": "created_at",
  2000. "isExpression": false,
  2001. "asc": true,
  2002. "nulls": "last"
  2003. }
  2004. ],
  2005. "isUnique": false,
  2006. "concurrently": false,
  2007. "method": "btree",
  2008. "with": {}
  2009. }
  2010. },
  2011. "foreignKeys": {},
  2012. "compositePrimaryKeys": {},
  2013. "uniqueConstraints": {},
  2014. "policies": {},
  2015. "checkConstraints": {},
  2016. "isRLSEnabled": false
  2017. },
  2018. "public.providers": {
  2019. "name": "providers",
  2020. "schema": "",
  2021. "columns": {
  2022. "id": {
  2023. "name": "id",
  2024. "type": "serial",
  2025. "primaryKey": true,
  2026. "notNull": true
  2027. },
  2028. "name": {
  2029. "name": "name",
  2030. "type": "varchar",
  2031. "primaryKey": false,
  2032. "notNull": true
  2033. },
  2034. "description": {
  2035. "name": "description",
  2036. "type": "text",
  2037. "primaryKey": false,
  2038. "notNull": false
  2039. },
  2040. "url": {
  2041. "name": "url",
  2042. "type": "varchar",
  2043. "primaryKey": false,
  2044. "notNull": true
  2045. },
  2046. "key": {
  2047. "name": "key",
  2048. "type": "varchar",
  2049. "primaryKey": false,
  2050. "notNull": true
  2051. },
  2052. "provider_vendor_id": {
  2053. "name": "provider_vendor_id",
  2054. "type": "integer",
  2055. "primaryKey": false,
  2056. "notNull": true
  2057. },
  2058. "is_enabled": {
  2059. "name": "is_enabled",
  2060. "type": "boolean",
  2061. "primaryKey": false,
  2062. "notNull": true,
  2063. "default": true
  2064. },
  2065. "weight": {
  2066. "name": "weight",
  2067. "type": "integer",
  2068. "primaryKey": false,
  2069. "notNull": true,
  2070. "default": 1
  2071. },
  2072. "priority": {
  2073. "name": "priority",
  2074. "type": "integer",
  2075. "primaryKey": false,
  2076. "notNull": true,
  2077. "default": 0
  2078. },
  2079. "group_priorities": {
  2080. "name": "group_priorities",
  2081. "type": "jsonb",
  2082. "primaryKey": false,
  2083. "notNull": false,
  2084. "default": "'null'::jsonb"
  2085. },
  2086. "cost_multiplier": {
  2087. "name": "cost_multiplier",
  2088. "type": "numeric(10, 4)",
  2089. "primaryKey": false,
  2090. "notNull": false,
  2091. "default": "'1.0'"
  2092. },
  2093. "group_tag": {
  2094. "name": "group_tag",
  2095. "type": "varchar(255)",
  2096. "primaryKey": false,
  2097. "notNull": false
  2098. },
  2099. "provider_type": {
  2100. "name": "provider_type",
  2101. "type": "varchar(20)",
  2102. "primaryKey": false,
  2103. "notNull": true,
  2104. "default": "'claude'"
  2105. },
  2106. "preserve_client_ip": {
  2107. "name": "preserve_client_ip",
  2108. "type": "boolean",
  2109. "primaryKey": false,
  2110. "notNull": true,
  2111. "default": false
  2112. },
  2113. "model_redirects": {
  2114. "name": "model_redirects",
  2115. "type": "jsonb",
  2116. "primaryKey": false,
  2117. "notNull": false
  2118. },
  2119. "allowed_models": {
  2120. "name": "allowed_models",
  2121. "type": "jsonb",
  2122. "primaryKey": false,
  2123. "notNull": false,
  2124. "default": "'null'::jsonb"
  2125. },
  2126. "allowed_clients": {
  2127. "name": "allowed_clients",
  2128. "type": "jsonb",
  2129. "primaryKey": false,
  2130. "notNull": true,
  2131. "default": "'[]'::jsonb"
  2132. },
  2133. "blocked_clients": {
  2134. "name": "blocked_clients",
  2135. "type": "jsonb",
  2136. "primaryKey": false,
  2137. "notNull": true,
  2138. "default": "'[]'::jsonb"
  2139. },
  2140. "active_time_start": {
  2141. "name": "active_time_start",
  2142. "type": "varchar(5)",
  2143. "primaryKey": false,
  2144. "notNull": false
  2145. },
  2146. "active_time_end": {
  2147. "name": "active_time_end",
  2148. "type": "varchar(5)",
  2149. "primaryKey": false,
  2150. "notNull": false
  2151. },
  2152. "codex_instructions_strategy": {
  2153. "name": "codex_instructions_strategy",
  2154. "type": "varchar(20)",
  2155. "primaryKey": false,
  2156. "notNull": false,
  2157. "default": "'auto'"
  2158. },
  2159. "mcp_passthrough_type": {
  2160. "name": "mcp_passthrough_type",
  2161. "type": "varchar(20)",
  2162. "primaryKey": false,
  2163. "notNull": true,
  2164. "default": "'none'"
  2165. },
  2166. "mcp_passthrough_url": {
  2167. "name": "mcp_passthrough_url",
  2168. "type": "varchar(512)",
  2169. "primaryKey": false,
  2170. "notNull": false
  2171. },
  2172. "limit_5h_usd": {
  2173. "name": "limit_5h_usd",
  2174. "type": "numeric(10, 2)",
  2175. "primaryKey": false,
  2176. "notNull": false
  2177. },
  2178. "limit_daily_usd": {
  2179. "name": "limit_daily_usd",
  2180. "type": "numeric(10, 2)",
  2181. "primaryKey": false,
  2182. "notNull": false
  2183. },
  2184. "daily_reset_mode": {
  2185. "name": "daily_reset_mode",
  2186. "type": "daily_reset_mode",
  2187. "typeSchema": "public",
  2188. "primaryKey": false,
  2189. "notNull": true,
  2190. "default": "'fixed'"
  2191. },
  2192. "daily_reset_time": {
  2193. "name": "daily_reset_time",
  2194. "type": "varchar(5)",
  2195. "primaryKey": false,
  2196. "notNull": true,
  2197. "default": "'00:00'"
  2198. },
  2199. "limit_weekly_usd": {
  2200. "name": "limit_weekly_usd",
  2201. "type": "numeric(10, 2)",
  2202. "primaryKey": false,
  2203. "notNull": false
  2204. },
  2205. "limit_monthly_usd": {
  2206. "name": "limit_monthly_usd",
  2207. "type": "numeric(10, 2)",
  2208. "primaryKey": false,
  2209. "notNull": false
  2210. },
  2211. "limit_total_usd": {
  2212. "name": "limit_total_usd",
  2213. "type": "numeric(10, 2)",
  2214. "primaryKey": false,
  2215. "notNull": false
  2216. },
  2217. "total_cost_reset_at": {
  2218. "name": "total_cost_reset_at",
  2219. "type": "timestamp with time zone",
  2220. "primaryKey": false,
  2221. "notNull": false
  2222. },
  2223. "limit_concurrent_sessions": {
  2224. "name": "limit_concurrent_sessions",
  2225. "type": "integer",
  2226. "primaryKey": false,
  2227. "notNull": false,
  2228. "default": 0
  2229. },
  2230. "max_retry_attempts": {
  2231. "name": "max_retry_attempts",
  2232. "type": "integer",
  2233. "primaryKey": false,
  2234. "notNull": false
  2235. },
  2236. "circuit_breaker_failure_threshold": {
  2237. "name": "circuit_breaker_failure_threshold",
  2238. "type": "integer",
  2239. "primaryKey": false,
  2240. "notNull": false,
  2241. "default": 5
  2242. },
  2243. "circuit_breaker_open_duration": {
  2244. "name": "circuit_breaker_open_duration",
  2245. "type": "integer",
  2246. "primaryKey": false,
  2247. "notNull": false,
  2248. "default": 1800000
  2249. },
  2250. "circuit_breaker_half_open_success_threshold": {
  2251. "name": "circuit_breaker_half_open_success_threshold",
  2252. "type": "integer",
  2253. "primaryKey": false,
  2254. "notNull": false,
  2255. "default": 2
  2256. },
  2257. "proxy_url": {
  2258. "name": "proxy_url",
  2259. "type": "varchar(512)",
  2260. "primaryKey": false,
  2261. "notNull": false
  2262. },
  2263. "proxy_fallback_to_direct": {
  2264. "name": "proxy_fallback_to_direct",
  2265. "type": "boolean",
  2266. "primaryKey": false,
  2267. "notNull": false,
  2268. "default": false
  2269. },
  2270. "first_byte_timeout_streaming_ms": {
  2271. "name": "first_byte_timeout_streaming_ms",
  2272. "type": "integer",
  2273. "primaryKey": false,
  2274. "notNull": true,
  2275. "default": 0
  2276. },
  2277. "streaming_idle_timeout_ms": {
  2278. "name": "streaming_idle_timeout_ms",
  2279. "type": "integer",
  2280. "primaryKey": false,
  2281. "notNull": true,
  2282. "default": 0
  2283. },
  2284. "request_timeout_non_streaming_ms": {
  2285. "name": "request_timeout_non_streaming_ms",
  2286. "type": "integer",
  2287. "primaryKey": false,
  2288. "notNull": true,
  2289. "default": 0
  2290. },
  2291. "website_url": {
  2292. "name": "website_url",
  2293. "type": "text",
  2294. "primaryKey": false,
  2295. "notNull": false
  2296. },
  2297. "favicon_url": {
  2298. "name": "favicon_url",
  2299. "type": "text",
  2300. "primaryKey": false,
  2301. "notNull": false
  2302. },
  2303. "cache_ttl_preference": {
  2304. "name": "cache_ttl_preference",
  2305. "type": "varchar(10)",
  2306. "primaryKey": false,
  2307. "notNull": false
  2308. },
  2309. "swap_cache_ttl_billing": {
  2310. "name": "swap_cache_ttl_billing",
  2311. "type": "boolean",
  2312. "primaryKey": false,
  2313. "notNull": true,
  2314. "default": false
  2315. },
  2316. "context_1m_preference": {
  2317. "name": "context_1m_preference",
  2318. "type": "varchar(20)",
  2319. "primaryKey": false,
  2320. "notNull": false
  2321. },
  2322. "codex_reasoning_effort_preference": {
  2323. "name": "codex_reasoning_effort_preference",
  2324. "type": "varchar(20)",
  2325. "primaryKey": false,
  2326. "notNull": false
  2327. },
  2328. "codex_reasoning_summary_preference": {
  2329. "name": "codex_reasoning_summary_preference",
  2330. "type": "varchar(20)",
  2331. "primaryKey": false,
  2332. "notNull": false
  2333. },
  2334. "codex_text_verbosity_preference": {
  2335. "name": "codex_text_verbosity_preference",
  2336. "type": "varchar(10)",
  2337. "primaryKey": false,
  2338. "notNull": false
  2339. },
  2340. "codex_parallel_tool_calls_preference": {
  2341. "name": "codex_parallel_tool_calls_preference",
  2342. "type": "varchar(10)",
  2343. "primaryKey": false,
  2344. "notNull": false
  2345. },
  2346. "codex_service_tier_preference": {
  2347. "name": "codex_service_tier_preference",
  2348. "type": "varchar(20)",
  2349. "primaryKey": false,
  2350. "notNull": false
  2351. },
  2352. "anthropic_max_tokens_preference": {
  2353. "name": "anthropic_max_tokens_preference",
  2354. "type": "varchar(20)",
  2355. "primaryKey": false,
  2356. "notNull": false
  2357. },
  2358. "anthropic_thinking_budget_preference": {
  2359. "name": "anthropic_thinking_budget_preference",
  2360. "type": "varchar(20)",
  2361. "primaryKey": false,
  2362. "notNull": false
  2363. },
  2364. "anthropic_adaptive_thinking": {
  2365. "name": "anthropic_adaptive_thinking",
  2366. "type": "jsonb",
  2367. "primaryKey": false,
  2368. "notNull": false,
  2369. "default": "'null'::jsonb"
  2370. },
  2371. "gemini_google_search_preference": {
  2372. "name": "gemini_google_search_preference",
  2373. "type": "varchar(20)",
  2374. "primaryKey": false,
  2375. "notNull": false
  2376. },
  2377. "tpm": {
  2378. "name": "tpm",
  2379. "type": "integer",
  2380. "primaryKey": false,
  2381. "notNull": false,
  2382. "default": 0
  2383. },
  2384. "rpm": {
  2385. "name": "rpm",
  2386. "type": "integer",
  2387. "primaryKey": false,
  2388. "notNull": false,
  2389. "default": 0
  2390. },
  2391. "rpd": {
  2392. "name": "rpd",
  2393. "type": "integer",
  2394. "primaryKey": false,
  2395. "notNull": false,
  2396. "default": 0
  2397. },
  2398. "cc": {
  2399. "name": "cc",
  2400. "type": "integer",
  2401. "primaryKey": false,
  2402. "notNull": false,
  2403. "default": 0
  2404. },
  2405. "created_at": {
  2406. "name": "created_at",
  2407. "type": "timestamp with time zone",
  2408. "primaryKey": false,
  2409. "notNull": false,
  2410. "default": "now()"
  2411. },
  2412. "updated_at": {
  2413. "name": "updated_at",
  2414. "type": "timestamp with time zone",
  2415. "primaryKey": false,
  2416. "notNull": false,
  2417. "default": "now()"
  2418. },
  2419. "deleted_at": {
  2420. "name": "deleted_at",
  2421. "type": "timestamp with time zone",
  2422. "primaryKey": false,
  2423. "notNull": false
  2424. }
  2425. },
  2426. "indexes": {
  2427. "idx_providers_enabled_priority": {
  2428. "name": "idx_providers_enabled_priority",
  2429. "columns": [
  2430. {
  2431. "expression": "is_enabled",
  2432. "isExpression": false,
  2433. "asc": true,
  2434. "nulls": "last"
  2435. },
  2436. {
  2437. "expression": "priority",
  2438. "isExpression": false,
  2439. "asc": true,
  2440. "nulls": "last"
  2441. },
  2442. {
  2443. "expression": "weight",
  2444. "isExpression": false,
  2445. "asc": true,
  2446. "nulls": "last"
  2447. }
  2448. ],
  2449. "isUnique": false,
  2450. "where": "\"providers\".\"deleted_at\" IS NULL",
  2451. "concurrently": false,
  2452. "method": "btree",
  2453. "with": {}
  2454. },
  2455. "idx_providers_group": {
  2456. "name": "idx_providers_group",
  2457. "columns": [
  2458. {
  2459. "expression": "group_tag",
  2460. "isExpression": false,
  2461. "asc": true,
  2462. "nulls": "last"
  2463. }
  2464. ],
  2465. "isUnique": false,
  2466. "where": "\"providers\".\"deleted_at\" IS NULL",
  2467. "concurrently": false,
  2468. "method": "btree",
  2469. "with": {}
  2470. },
  2471. "idx_providers_vendor_type_url_active": {
  2472. "name": "idx_providers_vendor_type_url_active",
  2473. "columns": [
  2474. {
  2475. "expression": "provider_vendor_id",
  2476. "isExpression": false,
  2477. "asc": true,
  2478. "nulls": "last"
  2479. },
  2480. {
  2481. "expression": "provider_type",
  2482. "isExpression": false,
  2483. "asc": true,
  2484. "nulls": "last"
  2485. },
  2486. {
  2487. "expression": "url",
  2488. "isExpression": false,
  2489. "asc": true,
  2490. "nulls": "last"
  2491. }
  2492. ],
  2493. "isUnique": false,
  2494. "where": "\"providers\".\"deleted_at\" IS NULL",
  2495. "concurrently": false,
  2496. "method": "btree",
  2497. "with": {}
  2498. },
  2499. "idx_providers_created_at": {
  2500. "name": "idx_providers_created_at",
  2501. "columns": [
  2502. {
  2503. "expression": "created_at",
  2504. "isExpression": false,
  2505. "asc": true,
  2506. "nulls": "last"
  2507. }
  2508. ],
  2509. "isUnique": false,
  2510. "concurrently": false,
  2511. "method": "btree",
  2512. "with": {}
  2513. },
  2514. "idx_providers_deleted_at": {
  2515. "name": "idx_providers_deleted_at",
  2516. "columns": [
  2517. {
  2518. "expression": "deleted_at",
  2519. "isExpression": false,
  2520. "asc": true,
  2521. "nulls": "last"
  2522. }
  2523. ],
  2524. "isUnique": false,
  2525. "concurrently": false,
  2526. "method": "btree",
  2527. "with": {}
  2528. },
  2529. "idx_providers_vendor_type": {
  2530. "name": "idx_providers_vendor_type",
  2531. "columns": [
  2532. {
  2533. "expression": "provider_vendor_id",
  2534. "isExpression": false,
  2535. "asc": true,
  2536. "nulls": "last"
  2537. },
  2538. {
  2539. "expression": "provider_type",
  2540. "isExpression": false,
  2541. "asc": true,
  2542. "nulls": "last"
  2543. }
  2544. ],
  2545. "isUnique": false,
  2546. "where": "\"providers\".\"deleted_at\" IS NULL",
  2547. "concurrently": false,
  2548. "method": "btree",
  2549. "with": {}
  2550. },
  2551. "idx_providers_enabled_vendor_type": {
  2552. "name": "idx_providers_enabled_vendor_type",
  2553. "columns": [
  2554. {
  2555. "expression": "provider_vendor_id",
  2556. "isExpression": false,
  2557. "asc": true,
  2558. "nulls": "last"
  2559. },
  2560. {
  2561. "expression": "provider_type",
  2562. "isExpression": false,
  2563. "asc": true,
  2564. "nulls": "last"
  2565. }
  2566. ],
  2567. "isUnique": false,
  2568. "where": "\"providers\".\"deleted_at\" IS NULL AND \"providers\".\"is_enabled\" = true AND \"providers\".\"provider_vendor_id\" IS NOT NULL AND \"providers\".\"provider_vendor_id\" > 0",
  2569. "concurrently": false,
  2570. "method": "btree",
  2571. "with": {}
  2572. }
  2573. },
  2574. "foreignKeys": {
  2575. "providers_provider_vendor_id_provider_vendors_id_fk": {
  2576. "name": "providers_provider_vendor_id_provider_vendors_id_fk",
  2577. "tableFrom": "providers",
  2578. "tableTo": "provider_vendors",
  2579. "columnsFrom": [
  2580. "provider_vendor_id"
  2581. ],
  2582. "columnsTo": [
  2583. "id"
  2584. ],
  2585. "onDelete": "restrict",
  2586. "onUpdate": "no action"
  2587. }
  2588. },
  2589. "compositePrimaryKeys": {},
  2590. "uniqueConstraints": {},
  2591. "policies": {},
  2592. "checkConstraints": {},
  2593. "isRLSEnabled": false
  2594. },
  2595. "public.request_filters": {
  2596. "name": "request_filters",
  2597. "schema": "",
  2598. "columns": {
  2599. "id": {
  2600. "name": "id",
  2601. "type": "serial",
  2602. "primaryKey": true,
  2603. "notNull": true
  2604. },
  2605. "name": {
  2606. "name": "name",
  2607. "type": "varchar(100)",
  2608. "primaryKey": false,
  2609. "notNull": true
  2610. },
  2611. "description": {
  2612. "name": "description",
  2613. "type": "text",
  2614. "primaryKey": false,
  2615. "notNull": false
  2616. },
  2617. "scope": {
  2618. "name": "scope",
  2619. "type": "varchar(20)",
  2620. "primaryKey": false,
  2621. "notNull": true
  2622. },
  2623. "action": {
  2624. "name": "action",
  2625. "type": "varchar(30)",
  2626. "primaryKey": false,
  2627. "notNull": true
  2628. },
  2629. "match_type": {
  2630. "name": "match_type",
  2631. "type": "varchar(20)",
  2632. "primaryKey": false,
  2633. "notNull": false
  2634. },
  2635. "target": {
  2636. "name": "target",
  2637. "type": "text",
  2638. "primaryKey": false,
  2639. "notNull": true
  2640. },
  2641. "replacement": {
  2642. "name": "replacement",
  2643. "type": "jsonb",
  2644. "primaryKey": false,
  2645. "notNull": false
  2646. },
  2647. "priority": {
  2648. "name": "priority",
  2649. "type": "integer",
  2650. "primaryKey": false,
  2651. "notNull": true,
  2652. "default": 0
  2653. },
  2654. "is_enabled": {
  2655. "name": "is_enabled",
  2656. "type": "boolean",
  2657. "primaryKey": false,
  2658. "notNull": true,
  2659. "default": true
  2660. },
  2661. "binding_type": {
  2662. "name": "binding_type",
  2663. "type": "varchar(20)",
  2664. "primaryKey": false,
  2665. "notNull": true,
  2666. "default": "'global'"
  2667. },
  2668. "provider_ids": {
  2669. "name": "provider_ids",
  2670. "type": "jsonb",
  2671. "primaryKey": false,
  2672. "notNull": false
  2673. },
  2674. "group_tags": {
  2675. "name": "group_tags",
  2676. "type": "jsonb",
  2677. "primaryKey": false,
  2678. "notNull": false
  2679. },
  2680. "rule_mode": {
  2681. "name": "rule_mode",
  2682. "type": "varchar(20)",
  2683. "primaryKey": false,
  2684. "notNull": true,
  2685. "default": "'simple'"
  2686. },
  2687. "execution_phase": {
  2688. "name": "execution_phase",
  2689. "type": "varchar(20)",
  2690. "primaryKey": false,
  2691. "notNull": true,
  2692. "default": "'guard'"
  2693. },
  2694. "operations": {
  2695. "name": "operations",
  2696. "type": "jsonb",
  2697. "primaryKey": false,
  2698. "notNull": false
  2699. },
  2700. "created_at": {
  2701. "name": "created_at",
  2702. "type": "timestamp with time zone",
  2703. "primaryKey": false,
  2704. "notNull": false,
  2705. "default": "now()"
  2706. },
  2707. "updated_at": {
  2708. "name": "updated_at",
  2709. "type": "timestamp with time zone",
  2710. "primaryKey": false,
  2711. "notNull": false,
  2712. "default": "now()"
  2713. }
  2714. },
  2715. "indexes": {
  2716. "idx_request_filters_enabled": {
  2717. "name": "idx_request_filters_enabled",
  2718. "columns": [
  2719. {
  2720. "expression": "is_enabled",
  2721. "isExpression": false,
  2722. "asc": true,
  2723. "nulls": "last"
  2724. },
  2725. {
  2726. "expression": "priority",
  2727. "isExpression": false,
  2728. "asc": true,
  2729. "nulls": "last"
  2730. }
  2731. ],
  2732. "isUnique": false,
  2733. "concurrently": false,
  2734. "method": "btree",
  2735. "with": {}
  2736. },
  2737. "idx_request_filters_scope": {
  2738. "name": "idx_request_filters_scope",
  2739. "columns": [
  2740. {
  2741. "expression": "scope",
  2742. "isExpression": false,
  2743. "asc": true,
  2744. "nulls": "last"
  2745. }
  2746. ],
  2747. "isUnique": false,
  2748. "concurrently": false,
  2749. "method": "btree",
  2750. "with": {}
  2751. },
  2752. "idx_request_filters_action": {
  2753. "name": "idx_request_filters_action",
  2754. "columns": [
  2755. {
  2756. "expression": "action",
  2757. "isExpression": false,
  2758. "asc": true,
  2759. "nulls": "last"
  2760. }
  2761. ],
  2762. "isUnique": false,
  2763. "concurrently": false,
  2764. "method": "btree",
  2765. "with": {}
  2766. },
  2767. "idx_request_filters_binding": {
  2768. "name": "idx_request_filters_binding",
  2769. "columns": [
  2770. {
  2771. "expression": "is_enabled",
  2772. "isExpression": false,
  2773. "asc": true,
  2774. "nulls": "last"
  2775. },
  2776. {
  2777. "expression": "binding_type",
  2778. "isExpression": false,
  2779. "asc": true,
  2780. "nulls": "last"
  2781. }
  2782. ],
  2783. "isUnique": false,
  2784. "concurrently": false,
  2785. "method": "btree",
  2786. "with": {}
  2787. },
  2788. "idx_request_filters_phase": {
  2789. "name": "idx_request_filters_phase",
  2790. "columns": [
  2791. {
  2792. "expression": "is_enabled",
  2793. "isExpression": false,
  2794. "asc": true,
  2795. "nulls": "last"
  2796. },
  2797. {
  2798. "expression": "execution_phase",
  2799. "isExpression": false,
  2800. "asc": true,
  2801. "nulls": "last"
  2802. }
  2803. ],
  2804. "isUnique": false,
  2805. "concurrently": false,
  2806. "method": "btree",
  2807. "with": {}
  2808. }
  2809. },
  2810. "foreignKeys": {},
  2811. "compositePrimaryKeys": {},
  2812. "uniqueConstraints": {},
  2813. "policies": {},
  2814. "checkConstraints": {},
  2815. "isRLSEnabled": false
  2816. },
  2817. "public.sensitive_words": {
  2818. "name": "sensitive_words",
  2819. "schema": "",
  2820. "columns": {
  2821. "id": {
  2822. "name": "id",
  2823. "type": "serial",
  2824. "primaryKey": true,
  2825. "notNull": true
  2826. },
  2827. "word": {
  2828. "name": "word",
  2829. "type": "varchar(255)",
  2830. "primaryKey": false,
  2831. "notNull": true
  2832. },
  2833. "match_type": {
  2834. "name": "match_type",
  2835. "type": "varchar(20)",
  2836. "primaryKey": false,
  2837. "notNull": true,
  2838. "default": "'contains'"
  2839. },
  2840. "description": {
  2841. "name": "description",
  2842. "type": "text",
  2843. "primaryKey": false,
  2844. "notNull": false
  2845. },
  2846. "is_enabled": {
  2847. "name": "is_enabled",
  2848. "type": "boolean",
  2849. "primaryKey": false,
  2850. "notNull": true,
  2851. "default": true
  2852. },
  2853. "created_at": {
  2854. "name": "created_at",
  2855. "type": "timestamp with time zone",
  2856. "primaryKey": false,
  2857. "notNull": false,
  2858. "default": "now()"
  2859. },
  2860. "updated_at": {
  2861. "name": "updated_at",
  2862. "type": "timestamp with time zone",
  2863. "primaryKey": false,
  2864. "notNull": false,
  2865. "default": "now()"
  2866. }
  2867. },
  2868. "indexes": {
  2869. "idx_sensitive_words_enabled": {
  2870. "name": "idx_sensitive_words_enabled",
  2871. "columns": [
  2872. {
  2873. "expression": "is_enabled",
  2874. "isExpression": false,
  2875. "asc": true,
  2876. "nulls": "last"
  2877. },
  2878. {
  2879. "expression": "match_type",
  2880. "isExpression": false,
  2881. "asc": true,
  2882. "nulls": "last"
  2883. }
  2884. ],
  2885. "isUnique": false,
  2886. "concurrently": false,
  2887. "method": "btree",
  2888. "with": {}
  2889. },
  2890. "idx_sensitive_words_created_at": {
  2891. "name": "idx_sensitive_words_created_at",
  2892. "columns": [
  2893. {
  2894. "expression": "created_at",
  2895. "isExpression": false,
  2896. "asc": true,
  2897. "nulls": "last"
  2898. }
  2899. ],
  2900. "isUnique": false,
  2901. "concurrently": false,
  2902. "method": "btree",
  2903. "with": {}
  2904. }
  2905. },
  2906. "foreignKeys": {},
  2907. "compositePrimaryKeys": {},
  2908. "uniqueConstraints": {},
  2909. "policies": {},
  2910. "checkConstraints": {},
  2911. "isRLSEnabled": false
  2912. },
  2913. "public.system_settings": {
  2914. "name": "system_settings",
  2915. "schema": "",
  2916. "columns": {
  2917. "id": {
  2918. "name": "id",
  2919. "type": "serial",
  2920. "primaryKey": true,
  2921. "notNull": true
  2922. },
  2923. "site_title": {
  2924. "name": "site_title",
  2925. "type": "varchar(128)",
  2926. "primaryKey": false,
  2927. "notNull": true,
  2928. "default": "'Claude Code Hub'"
  2929. },
  2930. "allow_global_usage_view": {
  2931. "name": "allow_global_usage_view",
  2932. "type": "boolean",
  2933. "primaryKey": false,
  2934. "notNull": true,
  2935. "default": false
  2936. },
  2937. "currency_display": {
  2938. "name": "currency_display",
  2939. "type": "varchar(10)",
  2940. "primaryKey": false,
  2941. "notNull": true,
  2942. "default": "'USD'"
  2943. },
  2944. "billing_model_source": {
  2945. "name": "billing_model_source",
  2946. "type": "varchar(20)",
  2947. "primaryKey": false,
  2948. "notNull": true,
  2949. "default": "'original'"
  2950. },
  2951. "codex_priority_billing_source": {
  2952. "name": "codex_priority_billing_source",
  2953. "type": "varchar(20)",
  2954. "primaryKey": false,
  2955. "notNull": true,
  2956. "default": "'requested'"
  2957. },
  2958. "timezone": {
  2959. "name": "timezone",
  2960. "type": "varchar(64)",
  2961. "primaryKey": false,
  2962. "notNull": false
  2963. },
  2964. "enable_auto_cleanup": {
  2965. "name": "enable_auto_cleanup",
  2966. "type": "boolean",
  2967. "primaryKey": false,
  2968. "notNull": false,
  2969. "default": false
  2970. },
  2971. "cleanup_retention_days": {
  2972. "name": "cleanup_retention_days",
  2973. "type": "integer",
  2974. "primaryKey": false,
  2975. "notNull": false,
  2976. "default": 30
  2977. },
  2978. "cleanup_schedule": {
  2979. "name": "cleanup_schedule",
  2980. "type": "varchar(50)",
  2981. "primaryKey": false,
  2982. "notNull": false,
  2983. "default": "'0 2 * * *'"
  2984. },
  2985. "cleanup_batch_size": {
  2986. "name": "cleanup_batch_size",
  2987. "type": "integer",
  2988. "primaryKey": false,
  2989. "notNull": false,
  2990. "default": 10000
  2991. },
  2992. "enable_client_version_check": {
  2993. "name": "enable_client_version_check",
  2994. "type": "boolean",
  2995. "primaryKey": false,
  2996. "notNull": true,
  2997. "default": false
  2998. },
  2999. "verbose_provider_error": {
  3000. "name": "verbose_provider_error",
  3001. "type": "boolean",
  3002. "primaryKey": false,
  3003. "notNull": true,
  3004. "default": false
  3005. },
  3006. "enable_http2": {
  3007. "name": "enable_http2",
  3008. "type": "boolean",
  3009. "primaryKey": false,
  3010. "notNull": true,
  3011. "default": false
  3012. },
  3013. "intercept_anthropic_warmup_requests": {
  3014. "name": "intercept_anthropic_warmup_requests",
  3015. "type": "boolean",
  3016. "primaryKey": false,
  3017. "notNull": true,
  3018. "default": false
  3019. },
  3020. "enable_thinking_signature_rectifier": {
  3021. "name": "enable_thinking_signature_rectifier",
  3022. "type": "boolean",
  3023. "primaryKey": false,
  3024. "notNull": true,
  3025. "default": true
  3026. },
  3027. "enable_thinking_budget_rectifier": {
  3028. "name": "enable_thinking_budget_rectifier",
  3029. "type": "boolean",
  3030. "primaryKey": false,
  3031. "notNull": true,
  3032. "default": true
  3033. },
  3034. "enable_billing_header_rectifier": {
  3035. "name": "enable_billing_header_rectifier",
  3036. "type": "boolean",
  3037. "primaryKey": false,
  3038. "notNull": true,
  3039. "default": true
  3040. },
  3041. "enable_response_input_rectifier": {
  3042. "name": "enable_response_input_rectifier",
  3043. "type": "boolean",
  3044. "primaryKey": false,
  3045. "notNull": true,
  3046. "default": true
  3047. },
  3048. "enable_codex_session_id_completion": {
  3049. "name": "enable_codex_session_id_completion",
  3050. "type": "boolean",
  3051. "primaryKey": false,
  3052. "notNull": true,
  3053. "default": true
  3054. },
  3055. "enable_claude_metadata_user_id_injection": {
  3056. "name": "enable_claude_metadata_user_id_injection",
  3057. "type": "boolean",
  3058. "primaryKey": false,
  3059. "notNull": true,
  3060. "default": true
  3061. },
  3062. "enable_response_fixer": {
  3063. "name": "enable_response_fixer",
  3064. "type": "boolean",
  3065. "primaryKey": false,
  3066. "notNull": true,
  3067. "default": true
  3068. },
  3069. "response_fixer_config": {
  3070. "name": "response_fixer_config",
  3071. "type": "jsonb",
  3072. "primaryKey": false,
  3073. "notNull": false,
  3074. "default": "'{\"fixTruncatedJson\":true,\"fixSseFormat\":true,\"fixEncoding\":true,\"maxJsonDepth\":200,\"maxFixSize\":1048576}'::jsonb"
  3075. },
  3076. "quota_db_refresh_interval_seconds": {
  3077. "name": "quota_db_refresh_interval_seconds",
  3078. "type": "integer",
  3079. "primaryKey": false,
  3080. "notNull": false,
  3081. "default": 10
  3082. },
  3083. "quota_lease_percent_5h": {
  3084. "name": "quota_lease_percent_5h",
  3085. "type": "numeric(5, 4)",
  3086. "primaryKey": false,
  3087. "notNull": false,
  3088. "default": "'0.05'"
  3089. },
  3090. "quota_lease_percent_daily": {
  3091. "name": "quota_lease_percent_daily",
  3092. "type": "numeric(5, 4)",
  3093. "primaryKey": false,
  3094. "notNull": false,
  3095. "default": "'0.05'"
  3096. },
  3097. "quota_lease_percent_weekly": {
  3098. "name": "quota_lease_percent_weekly",
  3099. "type": "numeric(5, 4)",
  3100. "primaryKey": false,
  3101. "notNull": false,
  3102. "default": "'0.05'"
  3103. },
  3104. "quota_lease_percent_monthly": {
  3105. "name": "quota_lease_percent_monthly",
  3106. "type": "numeric(5, 4)",
  3107. "primaryKey": false,
  3108. "notNull": false,
  3109. "default": "'0.05'"
  3110. },
  3111. "quota_lease_cap_usd": {
  3112. "name": "quota_lease_cap_usd",
  3113. "type": "numeric(10, 2)",
  3114. "primaryKey": false,
  3115. "notNull": false
  3116. },
  3117. "created_at": {
  3118. "name": "created_at",
  3119. "type": "timestamp with time zone",
  3120. "primaryKey": false,
  3121. "notNull": false,
  3122. "default": "now()"
  3123. },
  3124. "updated_at": {
  3125. "name": "updated_at",
  3126. "type": "timestamp with time zone",
  3127. "primaryKey": false,
  3128. "notNull": false,
  3129. "default": "now()"
  3130. }
  3131. },
  3132. "indexes": {},
  3133. "foreignKeys": {},
  3134. "compositePrimaryKeys": {},
  3135. "uniqueConstraints": {},
  3136. "policies": {},
  3137. "checkConstraints": {},
  3138. "isRLSEnabled": false
  3139. },
  3140. "public.usage_ledger": {
  3141. "name": "usage_ledger",
  3142. "schema": "",
  3143. "columns": {
  3144. "id": {
  3145. "name": "id",
  3146. "type": "serial",
  3147. "primaryKey": true,
  3148. "notNull": true
  3149. },
  3150. "request_id": {
  3151. "name": "request_id",
  3152. "type": "integer",
  3153. "primaryKey": false,
  3154. "notNull": true
  3155. },
  3156. "user_id": {
  3157. "name": "user_id",
  3158. "type": "integer",
  3159. "primaryKey": false,
  3160. "notNull": true
  3161. },
  3162. "key": {
  3163. "name": "key",
  3164. "type": "varchar",
  3165. "primaryKey": false,
  3166. "notNull": true
  3167. },
  3168. "provider_id": {
  3169. "name": "provider_id",
  3170. "type": "integer",
  3171. "primaryKey": false,
  3172. "notNull": true
  3173. },
  3174. "final_provider_id": {
  3175. "name": "final_provider_id",
  3176. "type": "integer",
  3177. "primaryKey": false,
  3178. "notNull": true
  3179. },
  3180. "model": {
  3181. "name": "model",
  3182. "type": "varchar(128)",
  3183. "primaryKey": false,
  3184. "notNull": false
  3185. },
  3186. "original_model": {
  3187. "name": "original_model",
  3188. "type": "varchar(128)",
  3189. "primaryKey": false,
  3190. "notNull": false
  3191. },
  3192. "endpoint": {
  3193. "name": "endpoint",
  3194. "type": "varchar(256)",
  3195. "primaryKey": false,
  3196. "notNull": false
  3197. },
  3198. "api_type": {
  3199. "name": "api_type",
  3200. "type": "varchar(20)",
  3201. "primaryKey": false,
  3202. "notNull": false
  3203. },
  3204. "session_id": {
  3205. "name": "session_id",
  3206. "type": "varchar(64)",
  3207. "primaryKey": false,
  3208. "notNull": false
  3209. },
  3210. "status_code": {
  3211. "name": "status_code",
  3212. "type": "integer",
  3213. "primaryKey": false,
  3214. "notNull": false
  3215. },
  3216. "is_success": {
  3217. "name": "is_success",
  3218. "type": "boolean",
  3219. "primaryKey": false,
  3220. "notNull": true,
  3221. "default": false
  3222. },
  3223. "blocked_by": {
  3224. "name": "blocked_by",
  3225. "type": "varchar(50)",
  3226. "primaryKey": false,
  3227. "notNull": false
  3228. },
  3229. "cost_usd": {
  3230. "name": "cost_usd",
  3231. "type": "numeric(21, 15)",
  3232. "primaryKey": false,
  3233. "notNull": false,
  3234. "default": "'0'"
  3235. },
  3236. "cost_multiplier": {
  3237. "name": "cost_multiplier",
  3238. "type": "numeric(10, 4)",
  3239. "primaryKey": false,
  3240. "notNull": false
  3241. },
  3242. "input_tokens": {
  3243. "name": "input_tokens",
  3244. "type": "bigint",
  3245. "primaryKey": false,
  3246. "notNull": false
  3247. },
  3248. "output_tokens": {
  3249. "name": "output_tokens",
  3250. "type": "bigint",
  3251. "primaryKey": false,
  3252. "notNull": false
  3253. },
  3254. "cache_creation_input_tokens": {
  3255. "name": "cache_creation_input_tokens",
  3256. "type": "bigint",
  3257. "primaryKey": false,
  3258. "notNull": false
  3259. },
  3260. "cache_read_input_tokens": {
  3261. "name": "cache_read_input_tokens",
  3262. "type": "bigint",
  3263. "primaryKey": false,
  3264. "notNull": false
  3265. },
  3266. "cache_creation_5m_input_tokens": {
  3267. "name": "cache_creation_5m_input_tokens",
  3268. "type": "bigint",
  3269. "primaryKey": false,
  3270. "notNull": false
  3271. },
  3272. "cache_creation_1h_input_tokens": {
  3273. "name": "cache_creation_1h_input_tokens",
  3274. "type": "bigint",
  3275. "primaryKey": false,
  3276. "notNull": false
  3277. },
  3278. "cache_ttl_applied": {
  3279. "name": "cache_ttl_applied",
  3280. "type": "varchar(10)",
  3281. "primaryKey": false,
  3282. "notNull": false
  3283. },
  3284. "context_1m_applied": {
  3285. "name": "context_1m_applied",
  3286. "type": "boolean",
  3287. "primaryKey": false,
  3288. "notNull": false,
  3289. "default": false
  3290. },
  3291. "swap_cache_ttl_applied": {
  3292. "name": "swap_cache_ttl_applied",
  3293. "type": "boolean",
  3294. "primaryKey": false,
  3295. "notNull": false,
  3296. "default": false
  3297. },
  3298. "duration_ms": {
  3299. "name": "duration_ms",
  3300. "type": "integer",
  3301. "primaryKey": false,
  3302. "notNull": false
  3303. },
  3304. "ttfb_ms": {
  3305. "name": "ttfb_ms",
  3306. "type": "integer",
  3307. "primaryKey": false,
  3308. "notNull": false
  3309. },
  3310. "created_at": {
  3311. "name": "created_at",
  3312. "type": "timestamp with time zone",
  3313. "primaryKey": false,
  3314. "notNull": true
  3315. }
  3316. },
  3317. "indexes": {
  3318. "idx_usage_ledger_request_id": {
  3319. "name": "idx_usage_ledger_request_id",
  3320. "columns": [
  3321. {
  3322. "expression": "request_id",
  3323. "isExpression": false,
  3324. "asc": true,
  3325. "nulls": "last"
  3326. }
  3327. ],
  3328. "isUnique": true,
  3329. "concurrently": false,
  3330. "method": "btree",
  3331. "with": {}
  3332. },
  3333. "idx_usage_ledger_user_created_at": {
  3334. "name": "idx_usage_ledger_user_created_at",
  3335. "columns": [
  3336. {
  3337. "expression": "user_id",
  3338. "isExpression": false,
  3339. "asc": true,
  3340. "nulls": "last"
  3341. },
  3342. {
  3343. "expression": "created_at",
  3344. "isExpression": false,
  3345. "asc": true,
  3346. "nulls": "last"
  3347. }
  3348. ],
  3349. "isUnique": false,
  3350. "where": "\"usage_ledger\".\"blocked_by\" IS NULL",
  3351. "concurrently": false,
  3352. "method": "btree",
  3353. "with": {}
  3354. },
  3355. "idx_usage_ledger_key_created_at": {
  3356. "name": "idx_usage_ledger_key_created_at",
  3357. "columns": [
  3358. {
  3359. "expression": "key",
  3360. "isExpression": false,
  3361. "asc": true,
  3362. "nulls": "last"
  3363. },
  3364. {
  3365. "expression": "created_at",
  3366. "isExpression": false,
  3367. "asc": true,
  3368. "nulls": "last"
  3369. }
  3370. ],
  3371. "isUnique": false,
  3372. "where": "\"usage_ledger\".\"blocked_by\" IS NULL",
  3373. "concurrently": false,
  3374. "method": "btree",
  3375. "with": {}
  3376. },
  3377. "idx_usage_ledger_provider_created_at": {
  3378. "name": "idx_usage_ledger_provider_created_at",
  3379. "columns": [
  3380. {
  3381. "expression": "final_provider_id",
  3382. "isExpression": false,
  3383. "asc": true,
  3384. "nulls": "last"
  3385. },
  3386. {
  3387. "expression": "created_at",
  3388. "isExpression": false,
  3389. "asc": true,
  3390. "nulls": "last"
  3391. }
  3392. ],
  3393. "isUnique": false,
  3394. "where": "\"usage_ledger\".\"blocked_by\" IS NULL",
  3395. "concurrently": false,
  3396. "method": "btree",
  3397. "with": {}
  3398. },
  3399. "idx_usage_ledger_created_at_minute": {
  3400. "name": "idx_usage_ledger_created_at_minute",
  3401. "columns": [
  3402. {
  3403. "expression": "date_trunc('minute', \"created_at\" AT TIME ZONE 'UTC')",
  3404. "asc": true,
  3405. "isExpression": true,
  3406. "nulls": "last"
  3407. }
  3408. ],
  3409. "isUnique": false,
  3410. "concurrently": false,
  3411. "method": "btree",
  3412. "with": {}
  3413. },
  3414. "idx_usage_ledger_created_at_desc_id": {
  3415. "name": "idx_usage_ledger_created_at_desc_id",
  3416. "columns": [
  3417. {
  3418. "expression": "created_at",
  3419. "isExpression": false,
  3420. "asc": false,
  3421. "nulls": "last"
  3422. },
  3423. {
  3424. "expression": "id",
  3425. "isExpression": false,
  3426. "asc": false,
  3427. "nulls": "last"
  3428. }
  3429. ],
  3430. "isUnique": false,
  3431. "concurrently": false,
  3432. "method": "btree",
  3433. "with": {}
  3434. },
  3435. "idx_usage_ledger_session_id": {
  3436. "name": "idx_usage_ledger_session_id",
  3437. "columns": [
  3438. {
  3439. "expression": "session_id",
  3440. "isExpression": false,
  3441. "asc": true,
  3442. "nulls": "last"
  3443. }
  3444. ],
  3445. "isUnique": false,
  3446. "where": "\"usage_ledger\".\"session_id\" IS NOT NULL",
  3447. "concurrently": false,
  3448. "method": "btree",
  3449. "with": {}
  3450. },
  3451. "idx_usage_ledger_model": {
  3452. "name": "idx_usage_ledger_model",
  3453. "columns": [
  3454. {
  3455. "expression": "model",
  3456. "isExpression": false,
  3457. "asc": true,
  3458. "nulls": "last"
  3459. }
  3460. ],
  3461. "isUnique": false,
  3462. "where": "\"usage_ledger\".\"model\" IS NOT NULL",
  3463. "concurrently": false,
  3464. "method": "btree",
  3465. "with": {}
  3466. },
  3467. "idx_usage_ledger_key_cost": {
  3468. "name": "idx_usage_ledger_key_cost",
  3469. "columns": [
  3470. {
  3471. "expression": "key",
  3472. "isExpression": false,
  3473. "asc": true,
  3474. "nulls": "last"
  3475. },
  3476. {
  3477. "expression": "created_at",
  3478. "isExpression": false,
  3479. "asc": true,
  3480. "nulls": "last"
  3481. },
  3482. {
  3483. "expression": "cost_usd",
  3484. "isExpression": false,
  3485. "asc": true,
  3486. "nulls": "last"
  3487. }
  3488. ],
  3489. "isUnique": false,
  3490. "where": "\"usage_ledger\".\"blocked_by\" IS NULL",
  3491. "concurrently": false,
  3492. "method": "btree",
  3493. "with": {}
  3494. },
  3495. "idx_usage_ledger_user_cost_cover": {
  3496. "name": "idx_usage_ledger_user_cost_cover",
  3497. "columns": [
  3498. {
  3499. "expression": "user_id",
  3500. "isExpression": false,
  3501. "asc": true,
  3502. "nulls": "last"
  3503. },
  3504. {
  3505. "expression": "created_at",
  3506. "isExpression": false,
  3507. "asc": true,
  3508. "nulls": "last"
  3509. },
  3510. {
  3511. "expression": "cost_usd",
  3512. "isExpression": false,
  3513. "asc": true,
  3514. "nulls": "last"
  3515. }
  3516. ],
  3517. "isUnique": false,
  3518. "where": "\"usage_ledger\".\"blocked_by\" IS NULL",
  3519. "concurrently": false,
  3520. "method": "btree",
  3521. "with": {}
  3522. },
  3523. "idx_usage_ledger_provider_cost_cover": {
  3524. "name": "idx_usage_ledger_provider_cost_cover",
  3525. "columns": [
  3526. {
  3527. "expression": "final_provider_id",
  3528. "isExpression": false,
  3529. "asc": true,
  3530. "nulls": "last"
  3531. },
  3532. {
  3533. "expression": "created_at",
  3534. "isExpression": false,
  3535. "asc": true,
  3536. "nulls": "last"
  3537. },
  3538. {
  3539. "expression": "cost_usd",
  3540. "isExpression": false,
  3541. "asc": true,
  3542. "nulls": "last"
  3543. }
  3544. ],
  3545. "isUnique": false,
  3546. "where": "\"usage_ledger\".\"blocked_by\" IS NULL",
  3547. "concurrently": false,
  3548. "method": "btree",
  3549. "with": {}
  3550. },
  3551. "idx_usage_ledger_key_created_at_desc_cover": {
  3552. "name": "idx_usage_ledger_key_created_at_desc_cover",
  3553. "columns": [
  3554. {
  3555. "expression": "key",
  3556. "isExpression": false,
  3557. "asc": true,
  3558. "nulls": "last"
  3559. },
  3560. {
  3561. "expression": "\"created_at\" DESC NULLS LAST",
  3562. "asc": true,
  3563. "isExpression": true,
  3564. "nulls": "last"
  3565. },
  3566. {
  3567. "expression": "final_provider_id",
  3568. "isExpression": false,
  3569. "asc": true,
  3570. "nulls": "last"
  3571. }
  3572. ],
  3573. "isUnique": false,
  3574. "where": "\"usage_ledger\".\"blocked_by\" IS NULL",
  3575. "concurrently": false,
  3576. "method": "btree",
  3577. "with": {}
  3578. }
  3579. },
  3580. "foreignKeys": {},
  3581. "compositePrimaryKeys": {},
  3582. "uniqueConstraints": {},
  3583. "policies": {},
  3584. "checkConstraints": {},
  3585. "isRLSEnabled": false
  3586. },
  3587. "public.users": {
  3588. "name": "users",
  3589. "schema": "",
  3590. "columns": {
  3591. "id": {
  3592. "name": "id",
  3593. "type": "serial",
  3594. "primaryKey": true,
  3595. "notNull": true
  3596. },
  3597. "name": {
  3598. "name": "name",
  3599. "type": "varchar",
  3600. "primaryKey": false,
  3601. "notNull": true
  3602. },
  3603. "description": {
  3604. "name": "description",
  3605. "type": "text",
  3606. "primaryKey": false,
  3607. "notNull": false
  3608. },
  3609. "role": {
  3610. "name": "role",
  3611. "type": "varchar",
  3612. "primaryKey": false,
  3613. "notNull": false,
  3614. "default": "'user'"
  3615. },
  3616. "rpm_limit": {
  3617. "name": "rpm_limit",
  3618. "type": "integer",
  3619. "primaryKey": false,
  3620. "notNull": false
  3621. },
  3622. "daily_limit_usd": {
  3623. "name": "daily_limit_usd",
  3624. "type": "numeric(10, 2)",
  3625. "primaryKey": false,
  3626. "notNull": false
  3627. },
  3628. "provider_group": {
  3629. "name": "provider_group",
  3630. "type": "varchar(200)",
  3631. "primaryKey": false,
  3632. "notNull": false,
  3633. "default": "'default'"
  3634. },
  3635. "tags": {
  3636. "name": "tags",
  3637. "type": "jsonb",
  3638. "primaryKey": false,
  3639. "notNull": false,
  3640. "default": "'[]'::jsonb"
  3641. },
  3642. "limit_5h_usd": {
  3643. "name": "limit_5h_usd",
  3644. "type": "numeric(10, 2)",
  3645. "primaryKey": false,
  3646. "notNull": false
  3647. },
  3648. "limit_weekly_usd": {
  3649. "name": "limit_weekly_usd",
  3650. "type": "numeric(10, 2)",
  3651. "primaryKey": false,
  3652. "notNull": false
  3653. },
  3654. "limit_monthly_usd": {
  3655. "name": "limit_monthly_usd",
  3656. "type": "numeric(10, 2)",
  3657. "primaryKey": false,
  3658. "notNull": false
  3659. },
  3660. "limit_total_usd": {
  3661. "name": "limit_total_usd",
  3662. "type": "numeric(10, 2)",
  3663. "primaryKey": false,
  3664. "notNull": false
  3665. },
  3666. "cost_reset_at": {
  3667. "name": "cost_reset_at",
  3668. "type": "timestamp with time zone",
  3669. "primaryKey": false,
  3670. "notNull": false
  3671. },
  3672. "limit_concurrent_sessions": {
  3673. "name": "limit_concurrent_sessions",
  3674. "type": "integer",
  3675. "primaryKey": false,
  3676. "notNull": false
  3677. },
  3678. "daily_reset_mode": {
  3679. "name": "daily_reset_mode",
  3680. "type": "daily_reset_mode",
  3681. "typeSchema": "public",
  3682. "primaryKey": false,
  3683. "notNull": true,
  3684. "default": "'fixed'"
  3685. },
  3686. "daily_reset_time": {
  3687. "name": "daily_reset_time",
  3688. "type": "varchar(5)",
  3689. "primaryKey": false,
  3690. "notNull": true,
  3691. "default": "'00:00'"
  3692. },
  3693. "is_enabled": {
  3694. "name": "is_enabled",
  3695. "type": "boolean",
  3696. "primaryKey": false,
  3697. "notNull": true,
  3698. "default": true
  3699. },
  3700. "expires_at": {
  3701. "name": "expires_at",
  3702. "type": "timestamp with time zone",
  3703. "primaryKey": false,
  3704. "notNull": false
  3705. },
  3706. "allowed_clients": {
  3707. "name": "allowed_clients",
  3708. "type": "jsonb",
  3709. "primaryKey": false,
  3710. "notNull": false,
  3711. "default": "'[]'::jsonb"
  3712. },
  3713. "allowed_models": {
  3714. "name": "allowed_models",
  3715. "type": "jsonb",
  3716. "primaryKey": false,
  3717. "notNull": false,
  3718. "default": "'[]'::jsonb"
  3719. },
  3720. "blocked_clients": {
  3721. "name": "blocked_clients",
  3722. "type": "jsonb",
  3723. "primaryKey": false,
  3724. "notNull": true,
  3725. "default": "'[]'::jsonb"
  3726. },
  3727. "created_at": {
  3728. "name": "created_at",
  3729. "type": "timestamp with time zone",
  3730. "primaryKey": false,
  3731. "notNull": false,
  3732. "default": "now()"
  3733. },
  3734. "updated_at": {
  3735. "name": "updated_at",
  3736. "type": "timestamp with time zone",
  3737. "primaryKey": false,
  3738. "notNull": false,
  3739. "default": "now()"
  3740. },
  3741. "deleted_at": {
  3742. "name": "deleted_at",
  3743. "type": "timestamp with time zone",
  3744. "primaryKey": false,
  3745. "notNull": false
  3746. }
  3747. },
  3748. "indexes": {
  3749. "idx_users_active_role_sort": {
  3750. "name": "idx_users_active_role_sort",
  3751. "columns": [
  3752. {
  3753. "expression": "deleted_at",
  3754. "isExpression": false,
  3755. "asc": true,
  3756. "nulls": "last"
  3757. },
  3758. {
  3759. "expression": "role",
  3760. "isExpression": false,
  3761. "asc": true,
  3762. "nulls": "last"
  3763. },
  3764. {
  3765. "expression": "id",
  3766. "isExpression": false,
  3767. "asc": true,
  3768. "nulls": "last"
  3769. }
  3770. ],
  3771. "isUnique": false,
  3772. "where": "\"users\".\"deleted_at\" IS NULL",
  3773. "concurrently": false,
  3774. "method": "btree",
  3775. "with": {}
  3776. },
  3777. "idx_users_enabled_expires_at": {
  3778. "name": "idx_users_enabled_expires_at",
  3779. "columns": [
  3780. {
  3781. "expression": "is_enabled",
  3782. "isExpression": false,
  3783. "asc": true,
  3784. "nulls": "last"
  3785. },
  3786. {
  3787. "expression": "expires_at",
  3788. "isExpression": false,
  3789. "asc": true,
  3790. "nulls": "last"
  3791. }
  3792. ],
  3793. "isUnique": false,
  3794. "where": "\"users\".\"deleted_at\" IS NULL",
  3795. "concurrently": false,
  3796. "method": "btree",
  3797. "with": {}
  3798. },
  3799. "idx_users_tags_gin": {
  3800. "name": "idx_users_tags_gin",
  3801. "columns": [
  3802. {
  3803. "expression": "tags",
  3804. "isExpression": false,
  3805. "asc": true,
  3806. "nulls": "last"
  3807. }
  3808. ],
  3809. "isUnique": false,
  3810. "where": "\"users\".\"deleted_at\" IS NULL",
  3811. "concurrently": false,
  3812. "method": "gin",
  3813. "with": {}
  3814. },
  3815. "idx_users_created_at": {
  3816. "name": "idx_users_created_at",
  3817. "columns": [
  3818. {
  3819. "expression": "created_at",
  3820. "isExpression": false,
  3821. "asc": true,
  3822. "nulls": "last"
  3823. }
  3824. ],
  3825. "isUnique": false,
  3826. "concurrently": false,
  3827. "method": "btree",
  3828. "with": {}
  3829. },
  3830. "idx_users_deleted_at": {
  3831. "name": "idx_users_deleted_at",
  3832. "columns": [
  3833. {
  3834. "expression": "deleted_at",
  3835. "isExpression": false,
  3836. "asc": true,
  3837. "nulls": "last"
  3838. }
  3839. ],
  3840. "isUnique": false,
  3841. "concurrently": false,
  3842. "method": "btree",
  3843. "with": {}
  3844. }
  3845. },
  3846. "foreignKeys": {},
  3847. "compositePrimaryKeys": {},
  3848. "uniqueConstraints": {},
  3849. "policies": {},
  3850. "checkConstraints": {},
  3851. "isRLSEnabled": false
  3852. },
  3853. "public.webhook_targets": {
  3854. "name": "webhook_targets",
  3855. "schema": "",
  3856. "columns": {
  3857. "id": {
  3858. "name": "id",
  3859. "type": "serial",
  3860. "primaryKey": true,
  3861. "notNull": true
  3862. },
  3863. "name": {
  3864. "name": "name",
  3865. "type": "varchar(100)",
  3866. "primaryKey": false,
  3867. "notNull": true
  3868. },
  3869. "provider_type": {
  3870. "name": "provider_type",
  3871. "type": "webhook_provider_type",
  3872. "typeSchema": "public",
  3873. "primaryKey": false,
  3874. "notNull": true
  3875. },
  3876. "webhook_url": {
  3877. "name": "webhook_url",
  3878. "type": "varchar(1024)",
  3879. "primaryKey": false,
  3880. "notNull": false
  3881. },
  3882. "telegram_bot_token": {
  3883. "name": "telegram_bot_token",
  3884. "type": "varchar(256)",
  3885. "primaryKey": false,
  3886. "notNull": false
  3887. },
  3888. "telegram_chat_id": {
  3889. "name": "telegram_chat_id",
  3890. "type": "varchar(64)",
  3891. "primaryKey": false,
  3892. "notNull": false
  3893. },
  3894. "dingtalk_secret": {
  3895. "name": "dingtalk_secret",
  3896. "type": "varchar(256)",
  3897. "primaryKey": false,
  3898. "notNull": false
  3899. },
  3900. "custom_template": {
  3901. "name": "custom_template",
  3902. "type": "jsonb",
  3903. "primaryKey": false,
  3904. "notNull": false
  3905. },
  3906. "custom_headers": {
  3907. "name": "custom_headers",
  3908. "type": "jsonb",
  3909. "primaryKey": false,
  3910. "notNull": false
  3911. },
  3912. "proxy_url": {
  3913. "name": "proxy_url",
  3914. "type": "varchar(512)",
  3915. "primaryKey": false,
  3916. "notNull": false
  3917. },
  3918. "proxy_fallback_to_direct": {
  3919. "name": "proxy_fallback_to_direct",
  3920. "type": "boolean",
  3921. "primaryKey": false,
  3922. "notNull": false,
  3923. "default": false
  3924. },
  3925. "is_enabled": {
  3926. "name": "is_enabled",
  3927. "type": "boolean",
  3928. "primaryKey": false,
  3929. "notNull": true,
  3930. "default": true
  3931. },
  3932. "last_test_at": {
  3933. "name": "last_test_at",
  3934. "type": "timestamp with time zone",
  3935. "primaryKey": false,
  3936. "notNull": false
  3937. },
  3938. "last_test_result": {
  3939. "name": "last_test_result",
  3940. "type": "jsonb",
  3941. "primaryKey": false,
  3942. "notNull": false
  3943. },
  3944. "created_at": {
  3945. "name": "created_at",
  3946. "type": "timestamp with time zone",
  3947. "primaryKey": false,
  3948. "notNull": false,
  3949. "default": "now()"
  3950. },
  3951. "updated_at": {
  3952. "name": "updated_at",
  3953. "type": "timestamp with time zone",
  3954. "primaryKey": false,
  3955. "notNull": false,
  3956. "default": "now()"
  3957. }
  3958. },
  3959. "indexes": {},
  3960. "foreignKeys": {},
  3961. "compositePrimaryKeys": {},
  3962. "uniqueConstraints": {},
  3963. "policies": {},
  3964. "checkConstraints": {},
  3965. "isRLSEnabled": false
  3966. }
  3967. },
  3968. "enums": {
  3969. "public.daily_reset_mode": {
  3970. "name": "daily_reset_mode",
  3971. "schema": "public",
  3972. "values": [
  3973. "fixed",
  3974. "rolling"
  3975. ]
  3976. },
  3977. "public.notification_type": {
  3978. "name": "notification_type",
  3979. "schema": "public",
  3980. "values": [
  3981. "circuit_breaker",
  3982. "daily_leaderboard",
  3983. "cost_alert",
  3984. "cache_hit_rate_alert"
  3985. ]
  3986. },
  3987. "public.webhook_provider_type": {
  3988. "name": "webhook_provider_type",
  3989. "schema": "public",
  3990. "values": [
  3991. "wechat",
  3992. "feishu",
  3993. "dingtalk",
  3994. "telegram",
  3995. "custom"
  3996. ]
  3997. }
  3998. },
  3999. "schemas": {},
  4000. "sequences": {},
  4001. "roles": {},
  4002. "policies": {},
  4003. "views": {},
  4004. "_meta": {
  4005. "columns": {},
  4006. "schemas": {},
  4007. "tables": {}
  4008. }
  4009. }