0079_snapshot.json 108 KB

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