0076_snapshot.json 107 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903
  1. {
  2. "id": "75cee3f5-1789-413b-a9ed-5aabc52fa0a0",
  3. "prevId": "61c4da35-57cf-4629-88de-a1af77c8ae3b",
  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. "join_claude_pool": {
  2135. "name": "join_claude_pool",
  2136. "type": "boolean",
  2137. "primaryKey": false,
  2138. "notNull": false,
  2139. "default": false
  2140. },
  2141. "codex_instructions_strategy": {
  2142. "name": "codex_instructions_strategy",
  2143. "type": "varchar(20)",
  2144. "primaryKey": false,
  2145. "notNull": false,
  2146. "default": "'auto'"
  2147. },
  2148. "mcp_passthrough_type": {
  2149. "name": "mcp_passthrough_type",
  2150. "type": "varchar(20)",
  2151. "primaryKey": false,
  2152. "notNull": true,
  2153. "default": "'none'"
  2154. },
  2155. "mcp_passthrough_url": {
  2156. "name": "mcp_passthrough_url",
  2157. "type": "varchar(512)",
  2158. "primaryKey": false,
  2159. "notNull": false
  2160. },
  2161. "limit_5h_usd": {
  2162. "name": "limit_5h_usd",
  2163. "type": "numeric(10, 2)",
  2164. "primaryKey": false,
  2165. "notNull": false
  2166. },
  2167. "limit_daily_usd": {
  2168. "name": "limit_daily_usd",
  2169. "type": "numeric(10, 2)",
  2170. "primaryKey": false,
  2171. "notNull": false
  2172. },
  2173. "daily_reset_mode": {
  2174. "name": "daily_reset_mode",
  2175. "type": "daily_reset_mode",
  2176. "typeSchema": "public",
  2177. "primaryKey": false,
  2178. "notNull": true,
  2179. "default": "'fixed'"
  2180. },
  2181. "daily_reset_time": {
  2182. "name": "daily_reset_time",
  2183. "type": "varchar(5)",
  2184. "primaryKey": false,
  2185. "notNull": true,
  2186. "default": "'00:00'"
  2187. },
  2188. "limit_weekly_usd": {
  2189. "name": "limit_weekly_usd",
  2190. "type": "numeric(10, 2)",
  2191. "primaryKey": false,
  2192. "notNull": false
  2193. },
  2194. "limit_monthly_usd": {
  2195. "name": "limit_monthly_usd",
  2196. "type": "numeric(10, 2)",
  2197. "primaryKey": false,
  2198. "notNull": false
  2199. },
  2200. "limit_total_usd": {
  2201. "name": "limit_total_usd",
  2202. "type": "numeric(10, 2)",
  2203. "primaryKey": false,
  2204. "notNull": false
  2205. },
  2206. "total_cost_reset_at": {
  2207. "name": "total_cost_reset_at",
  2208. "type": "timestamp with time zone",
  2209. "primaryKey": false,
  2210. "notNull": false
  2211. },
  2212. "limit_concurrent_sessions": {
  2213. "name": "limit_concurrent_sessions",
  2214. "type": "integer",
  2215. "primaryKey": false,
  2216. "notNull": false,
  2217. "default": 0
  2218. },
  2219. "max_retry_attempts": {
  2220. "name": "max_retry_attempts",
  2221. "type": "integer",
  2222. "primaryKey": false,
  2223. "notNull": false
  2224. },
  2225. "circuit_breaker_failure_threshold": {
  2226. "name": "circuit_breaker_failure_threshold",
  2227. "type": "integer",
  2228. "primaryKey": false,
  2229. "notNull": false,
  2230. "default": 5
  2231. },
  2232. "circuit_breaker_open_duration": {
  2233. "name": "circuit_breaker_open_duration",
  2234. "type": "integer",
  2235. "primaryKey": false,
  2236. "notNull": false,
  2237. "default": 1800000
  2238. },
  2239. "circuit_breaker_half_open_success_threshold": {
  2240. "name": "circuit_breaker_half_open_success_threshold",
  2241. "type": "integer",
  2242. "primaryKey": false,
  2243. "notNull": false,
  2244. "default": 2
  2245. },
  2246. "proxy_url": {
  2247. "name": "proxy_url",
  2248. "type": "varchar(512)",
  2249. "primaryKey": false,
  2250. "notNull": false
  2251. },
  2252. "proxy_fallback_to_direct": {
  2253. "name": "proxy_fallback_to_direct",
  2254. "type": "boolean",
  2255. "primaryKey": false,
  2256. "notNull": false,
  2257. "default": false
  2258. },
  2259. "first_byte_timeout_streaming_ms": {
  2260. "name": "first_byte_timeout_streaming_ms",
  2261. "type": "integer",
  2262. "primaryKey": false,
  2263. "notNull": true,
  2264. "default": 0
  2265. },
  2266. "streaming_idle_timeout_ms": {
  2267. "name": "streaming_idle_timeout_ms",
  2268. "type": "integer",
  2269. "primaryKey": false,
  2270. "notNull": true,
  2271. "default": 0
  2272. },
  2273. "request_timeout_non_streaming_ms": {
  2274. "name": "request_timeout_non_streaming_ms",
  2275. "type": "integer",
  2276. "primaryKey": false,
  2277. "notNull": true,
  2278. "default": 0
  2279. },
  2280. "website_url": {
  2281. "name": "website_url",
  2282. "type": "text",
  2283. "primaryKey": false,
  2284. "notNull": false
  2285. },
  2286. "favicon_url": {
  2287. "name": "favicon_url",
  2288. "type": "text",
  2289. "primaryKey": false,
  2290. "notNull": false
  2291. },
  2292. "cache_ttl_preference": {
  2293. "name": "cache_ttl_preference",
  2294. "type": "varchar(10)",
  2295. "primaryKey": false,
  2296. "notNull": false
  2297. },
  2298. "swap_cache_ttl_billing": {
  2299. "name": "swap_cache_ttl_billing",
  2300. "type": "boolean",
  2301. "primaryKey": false,
  2302. "notNull": true,
  2303. "default": false
  2304. },
  2305. "context_1m_preference": {
  2306. "name": "context_1m_preference",
  2307. "type": "varchar(20)",
  2308. "primaryKey": false,
  2309. "notNull": false
  2310. },
  2311. "codex_reasoning_effort_preference": {
  2312. "name": "codex_reasoning_effort_preference",
  2313. "type": "varchar(20)",
  2314. "primaryKey": false,
  2315. "notNull": false
  2316. },
  2317. "codex_reasoning_summary_preference": {
  2318. "name": "codex_reasoning_summary_preference",
  2319. "type": "varchar(20)",
  2320. "primaryKey": false,
  2321. "notNull": false
  2322. },
  2323. "codex_text_verbosity_preference": {
  2324. "name": "codex_text_verbosity_preference",
  2325. "type": "varchar(10)",
  2326. "primaryKey": false,
  2327. "notNull": false
  2328. },
  2329. "codex_parallel_tool_calls_preference": {
  2330. "name": "codex_parallel_tool_calls_preference",
  2331. "type": "varchar(10)",
  2332. "primaryKey": false,
  2333. "notNull": false
  2334. },
  2335. "anthropic_max_tokens_preference": {
  2336. "name": "anthropic_max_tokens_preference",
  2337. "type": "varchar(20)",
  2338. "primaryKey": false,
  2339. "notNull": false
  2340. },
  2341. "anthropic_thinking_budget_preference": {
  2342. "name": "anthropic_thinking_budget_preference",
  2343. "type": "varchar(20)",
  2344. "primaryKey": false,
  2345. "notNull": false
  2346. },
  2347. "anthropic_adaptive_thinking": {
  2348. "name": "anthropic_adaptive_thinking",
  2349. "type": "jsonb",
  2350. "primaryKey": false,
  2351. "notNull": false,
  2352. "default": "'null'::jsonb"
  2353. },
  2354. "gemini_google_search_preference": {
  2355. "name": "gemini_google_search_preference",
  2356. "type": "varchar(20)",
  2357. "primaryKey": false,
  2358. "notNull": false
  2359. },
  2360. "tpm": {
  2361. "name": "tpm",
  2362. "type": "integer",
  2363. "primaryKey": false,
  2364. "notNull": false,
  2365. "default": 0
  2366. },
  2367. "rpm": {
  2368. "name": "rpm",
  2369. "type": "integer",
  2370. "primaryKey": false,
  2371. "notNull": false,
  2372. "default": 0
  2373. },
  2374. "rpd": {
  2375. "name": "rpd",
  2376. "type": "integer",
  2377. "primaryKey": false,
  2378. "notNull": false,
  2379. "default": 0
  2380. },
  2381. "cc": {
  2382. "name": "cc",
  2383. "type": "integer",
  2384. "primaryKey": false,
  2385. "notNull": false,
  2386. "default": 0
  2387. },
  2388. "created_at": {
  2389. "name": "created_at",
  2390. "type": "timestamp with time zone",
  2391. "primaryKey": false,
  2392. "notNull": false,
  2393. "default": "now()"
  2394. },
  2395. "updated_at": {
  2396. "name": "updated_at",
  2397. "type": "timestamp with time zone",
  2398. "primaryKey": false,
  2399. "notNull": false,
  2400. "default": "now()"
  2401. },
  2402. "deleted_at": {
  2403. "name": "deleted_at",
  2404. "type": "timestamp with time zone",
  2405. "primaryKey": false,
  2406. "notNull": false
  2407. }
  2408. },
  2409. "indexes": {
  2410. "idx_providers_enabled_priority": {
  2411. "name": "idx_providers_enabled_priority",
  2412. "columns": [
  2413. {
  2414. "expression": "is_enabled",
  2415. "isExpression": false,
  2416. "asc": true,
  2417. "nulls": "last"
  2418. },
  2419. {
  2420. "expression": "priority",
  2421. "isExpression": false,
  2422. "asc": true,
  2423. "nulls": "last"
  2424. },
  2425. {
  2426. "expression": "weight",
  2427. "isExpression": false,
  2428. "asc": true,
  2429. "nulls": "last"
  2430. }
  2431. ],
  2432. "isUnique": false,
  2433. "where": "\"providers\".\"deleted_at\" IS NULL",
  2434. "concurrently": false,
  2435. "method": "btree",
  2436. "with": {}
  2437. },
  2438. "idx_providers_group": {
  2439. "name": "idx_providers_group",
  2440. "columns": [
  2441. {
  2442. "expression": "group_tag",
  2443. "isExpression": false,
  2444. "asc": true,
  2445. "nulls": "last"
  2446. }
  2447. ],
  2448. "isUnique": false,
  2449. "where": "\"providers\".\"deleted_at\" IS NULL",
  2450. "concurrently": false,
  2451. "method": "btree",
  2452. "with": {}
  2453. },
  2454. "idx_providers_vendor_type_url_active": {
  2455. "name": "idx_providers_vendor_type_url_active",
  2456. "columns": [
  2457. {
  2458. "expression": "provider_vendor_id",
  2459. "isExpression": false,
  2460. "asc": true,
  2461. "nulls": "last"
  2462. },
  2463. {
  2464. "expression": "provider_type",
  2465. "isExpression": false,
  2466. "asc": true,
  2467. "nulls": "last"
  2468. },
  2469. {
  2470. "expression": "url",
  2471. "isExpression": false,
  2472. "asc": true,
  2473. "nulls": "last"
  2474. }
  2475. ],
  2476. "isUnique": false,
  2477. "where": "\"providers\".\"deleted_at\" IS NULL",
  2478. "concurrently": false,
  2479. "method": "btree",
  2480. "with": {}
  2481. },
  2482. "idx_providers_created_at": {
  2483. "name": "idx_providers_created_at",
  2484. "columns": [
  2485. {
  2486. "expression": "created_at",
  2487. "isExpression": false,
  2488. "asc": true,
  2489. "nulls": "last"
  2490. }
  2491. ],
  2492. "isUnique": false,
  2493. "concurrently": false,
  2494. "method": "btree",
  2495. "with": {}
  2496. },
  2497. "idx_providers_deleted_at": {
  2498. "name": "idx_providers_deleted_at",
  2499. "columns": [
  2500. {
  2501. "expression": "deleted_at",
  2502. "isExpression": false,
  2503. "asc": true,
  2504. "nulls": "last"
  2505. }
  2506. ],
  2507. "isUnique": false,
  2508. "concurrently": false,
  2509. "method": "btree",
  2510. "with": {}
  2511. },
  2512. "idx_providers_vendor_type": {
  2513. "name": "idx_providers_vendor_type",
  2514. "columns": [
  2515. {
  2516. "expression": "provider_vendor_id",
  2517. "isExpression": false,
  2518. "asc": true,
  2519. "nulls": "last"
  2520. },
  2521. {
  2522. "expression": "provider_type",
  2523. "isExpression": false,
  2524. "asc": true,
  2525. "nulls": "last"
  2526. }
  2527. ],
  2528. "isUnique": false,
  2529. "where": "\"providers\".\"deleted_at\" IS NULL",
  2530. "concurrently": false,
  2531. "method": "btree",
  2532. "with": {}
  2533. },
  2534. "idx_providers_enabled_vendor_type": {
  2535. "name": "idx_providers_enabled_vendor_type",
  2536. "columns": [
  2537. {
  2538. "expression": "provider_vendor_id",
  2539. "isExpression": false,
  2540. "asc": true,
  2541. "nulls": "last"
  2542. },
  2543. {
  2544. "expression": "provider_type",
  2545. "isExpression": false,
  2546. "asc": true,
  2547. "nulls": "last"
  2548. }
  2549. ],
  2550. "isUnique": false,
  2551. "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",
  2552. "concurrently": false,
  2553. "method": "btree",
  2554. "with": {}
  2555. }
  2556. },
  2557. "foreignKeys": {
  2558. "providers_provider_vendor_id_provider_vendors_id_fk": {
  2559. "name": "providers_provider_vendor_id_provider_vendors_id_fk",
  2560. "tableFrom": "providers",
  2561. "tableTo": "provider_vendors",
  2562. "columnsFrom": [
  2563. "provider_vendor_id"
  2564. ],
  2565. "columnsTo": [
  2566. "id"
  2567. ],
  2568. "onDelete": "restrict",
  2569. "onUpdate": "no action"
  2570. }
  2571. },
  2572. "compositePrimaryKeys": {},
  2573. "uniqueConstraints": {},
  2574. "policies": {},
  2575. "checkConstraints": {},
  2576. "isRLSEnabled": false
  2577. },
  2578. "public.request_filters": {
  2579. "name": "request_filters",
  2580. "schema": "",
  2581. "columns": {
  2582. "id": {
  2583. "name": "id",
  2584. "type": "serial",
  2585. "primaryKey": true,
  2586. "notNull": true
  2587. },
  2588. "name": {
  2589. "name": "name",
  2590. "type": "varchar(100)",
  2591. "primaryKey": false,
  2592. "notNull": true
  2593. },
  2594. "description": {
  2595. "name": "description",
  2596. "type": "text",
  2597. "primaryKey": false,
  2598. "notNull": false
  2599. },
  2600. "scope": {
  2601. "name": "scope",
  2602. "type": "varchar(20)",
  2603. "primaryKey": false,
  2604. "notNull": true
  2605. },
  2606. "action": {
  2607. "name": "action",
  2608. "type": "varchar(30)",
  2609. "primaryKey": false,
  2610. "notNull": true
  2611. },
  2612. "match_type": {
  2613. "name": "match_type",
  2614. "type": "varchar(20)",
  2615. "primaryKey": false,
  2616. "notNull": false
  2617. },
  2618. "target": {
  2619. "name": "target",
  2620. "type": "text",
  2621. "primaryKey": false,
  2622. "notNull": true
  2623. },
  2624. "replacement": {
  2625. "name": "replacement",
  2626. "type": "jsonb",
  2627. "primaryKey": false,
  2628. "notNull": false
  2629. },
  2630. "priority": {
  2631. "name": "priority",
  2632. "type": "integer",
  2633. "primaryKey": false,
  2634. "notNull": true,
  2635. "default": 0
  2636. },
  2637. "is_enabled": {
  2638. "name": "is_enabled",
  2639. "type": "boolean",
  2640. "primaryKey": false,
  2641. "notNull": true,
  2642. "default": true
  2643. },
  2644. "binding_type": {
  2645. "name": "binding_type",
  2646. "type": "varchar(20)",
  2647. "primaryKey": false,
  2648. "notNull": true,
  2649. "default": "'global'"
  2650. },
  2651. "provider_ids": {
  2652. "name": "provider_ids",
  2653. "type": "jsonb",
  2654. "primaryKey": false,
  2655. "notNull": false
  2656. },
  2657. "group_tags": {
  2658. "name": "group_tags",
  2659. "type": "jsonb",
  2660. "primaryKey": false,
  2661. "notNull": false
  2662. },
  2663. "created_at": {
  2664. "name": "created_at",
  2665. "type": "timestamp with time zone",
  2666. "primaryKey": false,
  2667. "notNull": false,
  2668. "default": "now()"
  2669. },
  2670. "updated_at": {
  2671. "name": "updated_at",
  2672. "type": "timestamp with time zone",
  2673. "primaryKey": false,
  2674. "notNull": false,
  2675. "default": "now()"
  2676. }
  2677. },
  2678. "indexes": {
  2679. "idx_request_filters_enabled": {
  2680. "name": "idx_request_filters_enabled",
  2681. "columns": [
  2682. {
  2683. "expression": "is_enabled",
  2684. "isExpression": false,
  2685. "asc": true,
  2686. "nulls": "last"
  2687. },
  2688. {
  2689. "expression": "priority",
  2690. "isExpression": false,
  2691. "asc": true,
  2692. "nulls": "last"
  2693. }
  2694. ],
  2695. "isUnique": false,
  2696. "concurrently": false,
  2697. "method": "btree",
  2698. "with": {}
  2699. },
  2700. "idx_request_filters_scope": {
  2701. "name": "idx_request_filters_scope",
  2702. "columns": [
  2703. {
  2704. "expression": "scope",
  2705. "isExpression": false,
  2706. "asc": true,
  2707. "nulls": "last"
  2708. }
  2709. ],
  2710. "isUnique": false,
  2711. "concurrently": false,
  2712. "method": "btree",
  2713. "with": {}
  2714. },
  2715. "idx_request_filters_action": {
  2716. "name": "idx_request_filters_action",
  2717. "columns": [
  2718. {
  2719. "expression": "action",
  2720. "isExpression": false,
  2721. "asc": true,
  2722. "nulls": "last"
  2723. }
  2724. ],
  2725. "isUnique": false,
  2726. "concurrently": false,
  2727. "method": "btree",
  2728. "with": {}
  2729. },
  2730. "idx_request_filters_binding": {
  2731. "name": "idx_request_filters_binding",
  2732. "columns": [
  2733. {
  2734. "expression": "is_enabled",
  2735. "isExpression": false,
  2736. "asc": true,
  2737. "nulls": "last"
  2738. },
  2739. {
  2740. "expression": "binding_type",
  2741. "isExpression": false,
  2742. "asc": true,
  2743. "nulls": "last"
  2744. }
  2745. ],
  2746. "isUnique": false,
  2747. "concurrently": false,
  2748. "method": "btree",
  2749. "with": {}
  2750. }
  2751. },
  2752. "foreignKeys": {},
  2753. "compositePrimaryKeys": {},
  2754. "uniqueConstraints": {},
  2755. "policies": {},
  2756. "checkConstraints": {},
  2757. "isRLSEnabled": false
  2758. },
  2759. "public.sensitive_words": {
  2760. "name": "sensitive_words",
  2761. "schema": "",
  2762. "columns": {
  2763. "id": {
  2764. "name": "id",
  2765. "type": "serial",
  2766. "primaryKey": true,
  2767. "notNull": true
  2768. },
  2769. "word": {
  2770. "name": "word",
  2771. "type": "varchar(255)",
  2772. "primaryKey": false,
  2773. "notNull": true
  2774. },
  2775. "match_type": {
  2776. "name": "match_type",
  2777. "type": "varchar(20)",
  2778. "primaryKey": false,
  2779. "notNull": true,
  2780. "default": "'contains'"
  2781. },
  2782. "description": {
  2783. "name": "description",
  2784. "type": "text",
  2785. "primaryKey": false,
  2786. "notNull": false
  2787. },
  2788. "is_enabled": {
  2789. "name": "is_enabled",
  2790. "type": "boolean",
  2791. "primaryKey": false,
  2792. "notNull": true,
  2793. "default": true
  2794. },
  2795. "created_at": {
  2796. "name": "created_at",
  2797. "type": "timestamp with time zone",
  2798. "primaryKey": false,
  2799. "notNull": false,
  2800. "default": "now()"
  2801. },
  2802. "updated_at": {
  2803. "name": "updated_at",
  2804. "type": "timestamp with time zone",
  2805. "primaryKey": false,
  2806. "notNull": false,
  2807. "default": "now()"
  2808. }
  2809. },
  2810. "indexes": {
  2811. "idx_sensitive_words_enabled": {
  2812. "name": "idx_sensitive_words_enabled",
  2813. "columns": [
  2814. {
  2815. "expression": "is_enabled",
  2816. "isExpression": false,
  2817. "asc": true,
  2818. "nulls": "last"
  2819. },
  2820. {
  2821. "expression": "match_type",
  2822. "isExpression": false,
  2823. "asc": true,
  2824. "nulls": "last"
  2825. }
  2826. ],
  2827. "isUnique": false,
  2828. "concurrently": false,
  2829. "method": "btree",
  2830. "with": {}
  2831. },
  2832. "idx_sensitive_words_created_at": {
  2833. "name": "idx_sensitive_words_created_at",
  2834. "columns": [
  2835. {
  2836. "expression": "created_at",
  2837. "isExpression": false,
  2838. "asc": true,
  2839. "nulls": "last"
  2840. }
  2841. ],
  2842. "isUnique": false,
  2843. "concurrently": false,
  2844. "method": "btree",
  2845. "with": {}
  2846. }
  2847. },
  2848. "foreignKeys": {},
  2849. "compositePrimaryKeys": {},
  2850. "uniqueConstraints": {},
  2851. "policies": {},
  2852. "checkConstraints": {},
  2853. "isRLSEnabled": false
  2854. },
  2855. "public.system_settings": {
  2856. "name": "system_settings",
  2857. "schema": "",
  2858. "columns": {
  2859. "id": {
  2860. "name": "id",
  2861. "type": "serial",
  2862. "primaryKey": true,
  2863. "notNull": true
  2864. },
  2865. "site_title": {
  2866. "name": "site_title",
  2867. "type": "varchar(128)",
  2868. "primaryKey": false,
  2869. "notNull": true,
  2870. "default": "'Claude Code Hub'"
  2871. },
  2872. "allow_global_usage_view": {
  2873. "name": "allow_global_usage_view",
  2874. "type": "boolean",
  2875. "primaryKey": false,
  2876. "notNull": true,
  2877. "default": false
  2878. },
  2879. "currency_display": {
  2880. "name": "currency_display",
  2881. "type": "varchar(10)",
  2882. "primaryKey": false,
  2883. "notNull": true,
  2884. "default": "'USD'"
  2885. },
  2886. "billing_model_source": {
  2887. "name": "billing_model_source",
  2888. "type": "varchar(20)",
  2889. "primaryKey": false,
  2890. "notNull": true,
  2891. "default": "'original'"
  2892. },
  2893. "timezone": {
  2894. "name": "timezone",
  2895. "type": "varchar(64)",
  2896. "primaryKey": false,
  2897. "notNull": false
  2898. },
  2899. "enable_auto_cleanup": {
  2900. "name": "enable_auto_cleanup",
  2901. "type": "boolean",
  2902. "primaryKey": false,
  2903. "notNull": false,
  2904. "default": false
  2905. },
  2906. "cleanup_retention_days": {
  2907. "name": "cleanup_retention_days",
  2908. "type": "integer",
  2909. "primaryKey": false,
  2910. "notNull": false,
  2911. "default": 30
  2912. },
  2913. "cleanup_schedule": {
  2914. "name": "cleanup_schedule",
  2915. "type": "varchar(50)",
  2916. "primaryKey": false,
  2917. "notNull": false,
  2918. "default": "'0 2 * * *'"
  2919. },
  2920. "cleanup_batch_size": {
  2921. "name": "cleanup_batch_size",
  2922. "type": "integer",
  2923. "primaryKey": false,
  2924. "notNull": false,
  2925. "default": 10000
  2926. },
  2927. "enable_client_version_check": {
  2928. "name": "enable_client_version_check",
  2929. "type": "boolean",
  2930. "primaryKey": false,
  2931. "notNull": true,
  2932. "default": false
  2933. },
  2934. "verbose_provider_error": {
  2935. "name": "verbose_provider_error",
  2936. "type": "boolean",
  2937. "primaryKey": false,
  2938. "notNull": true,
  2939. "default": false
  2940. },
  2941. "enable_http2": {
  2942. "name": "enable_http2",
  2943. "type": "boolean",
  2944. "primaryKey": false,
  2945. "notNull": true,
  2946. "default": false
  2947. },
  2948. "intercept_anthropic_warmup_requests": {
  2949. "name": "intercept_anthropic_warmup_requests",
  2950. "type": "boolean",
  2951. "primaryKey": false,
  2952. "notNull": true,
  2953. "default": false
  2954. },
  2955. "enable_thinking_signature_rectifier": {
  2956. "name": "enable_thinking_signature_rectifier",
  2957. "type": "boolean",
  2958. "primaryKey": false,
  2959. "notNull": true,
  2960. "default": true
  2961. },
  2962. "enable_thinking_budget_rectifier": {
  2963. "name": "enable_thinking_budget_rectifier",
  2964. "type": "boolean",
  2965. "primaryKey": false,
  2966. "notNull": true,
  2967. "default": true
  2968. },
  2969. "enable_billing_header_rectifier": {
  2970. "name": "enable_billing_header_rectifier",
  2971. "type": "boolean",
  2972. "primaryKey": false,
  2973. "notNull": true,
  2974. "default": true
  2975. },
  2976. "enable_codex_session_id_completion": {
  2977. "name": "enable_codex_session_id_completion",
  2978. "type": "boolean",
  2979. "primaryKey": false,
  2980. "notNull": true,
  2981. "default": true
  2982. },
  2983. "enable_claude_metadata_user_id_injection": {
  2984. "name": "enable_claude_metadata_user_id_injection",
  2985. "type": "boolean",
  2986. "primaryKey": false,
  2987. "notNull": true,
  2988. "default": true
  2989. },
  2990. "enable_response_fixer": {
  2991. "name": "enable_response_fixer",
  2992. "type": "boolean",
  2993. "primaryKey": false,
  2994. "notNull": true,
  2995. "default": true
  2996. },
  2997. "response_fixer_config": {
  2998. "name": "response_fixer_config",
  2999. "type": "jsonb",
  3000. "primaryKey": false,
  3001. "notNull": false,
  3002. "default": "'{\"fixTruncatedJson\":true,\"fixSseFormat\":true,\"fixEncoding\":true,\"maxJsonDepth\":200,\"maxFixSize\":1048576}'::jsonb"
  3003. },
  3004. "quota_db_refresh_interval_seconds": {
  3005. "name": "quota_db_refresh_interval_seconds",
  3006. "type": "integer",
  3007. "primaryKey": false,
  3008. "notNull": false,
  3009. "default": 10
  3010. },
  3011. "quota_lease_percent_5h": {
  3012. "name": "quota_lease_percent_5h",
  3013. "type": "numeric(5, 4)",
  3014. "primaryKey": false,
  3015. "notNull": false,
  3016. "default": "'0.05'"
  3017. },
  3018. "quota_lease_percent_daily": {
  3019. "name": "quota_lease_percent_daily",
  3020. "type": "numeric(5, 4)",
  3021. "primaryKey": false,
  3022. "notNull": false,
  3023. "default": "'0.05'"
  3024. },
  3025. "quota_lease_percent_weekly": {
  3026. "name": "quota_lease_percent_weekly",
  3027. "type": "numeric(5, 4)",
  3028. "primaryKey": false,
  3029. "notNull": false,
  3030. "default": "'0.05'"
  3031. },
  3032. "quota_lease_percent_monthly": {
  3033. "name": "quota_lease_percent_monthly",
  3034. "type": "numeric(5, 4)",
  3035. "primaryKey": false,
  3036. "notNull": false,
  3037. "default": "'0.05'"
  3038. },
  3039. "quota_lease_cap_usd": {
  3040. "name": "quota_lease_cap_usd",
  3041. "type": "numeric(10, 2)",
  3042. "primaryKey": false,
  3043. "notNull": false
  3044. },
  3045. "created_at": {
  3046. "name": "created_at",
  3047. "type": "timestamp with time zone",
  3048. "primaryKey": false,
  3049. "notNull": false,
  3050. "default": "now()"
  3051. },
  3052. "updated_at": {
  3053. "name": "updated_at",
  3054. "type": "timestamp with time zone",
  3055. "primaryKey": false,
  3056. "notNull": false,
  3057. "default": "now()"
  3058. }
  3059. },
  3060. "indexes": {},
  3061. "foreignKeys": {},
  3062. "compositePrimaryKeys": {},
  3063. "uniqueConstraints": {},
  3064. "policies": {},
  3065. "checkConstraints": {},
  3066. "isRLSEnabled": false
  3067. },
  3068. "public.usage_ledger": {
  3069. "name": "usage_ledger",
  3070. "schema": "",
  3071. "columns": {
  3072. "id": {
  3073. "name": "id",
  3074. "type": "serial",
  3075. "primaryKey": true,
  3076. "notNull": true
  3077. },
  3078. "request_id": {
  3079. "name": "request_id",
  3080. "type": "integer",
  3081. "primaryKey": false,
  3082. "notNull": true
  3083. },
  3084. "user_id": {
  3085. "name": "user_id",
  3086. "type": "integer",
  3087. "primaryKey": false,
  3088. "notNull": true
  3089. },
  3090. "key": {
  3091. "name": "key",
  3092. "type": "varchar",
  3093. "primaryKey": false,
  3094. "notNull": true
  3095. },
  3096. "provider_id": {
  3097. "name": "provider_id",
  3098. "type": "integer",
  3099. "primaryKey": false,
  3100. "notNull": true
  3101. },
  3102. "final_provider_id": {
  3103. "name": "final_provider_id",
  3104. "type": "integer",
  3105. "primaryKey": false,
  3106. "notNull": true
  3107. },
  3108. "model": {
  3109. "name": "model",
  3110. "type": "varchar(128)",
  3111. "primaryKey": false,
  3112. "notNull": false
  3113. },
  3114. "original_model": {
  3115. "name": "original_model",
  3116. "type": "varchar(128)",
  3117. "primaryKey": false,
  3118. "notNull": false
  3119. },
  3120. "endpoint": {
  3121. "name": "endpoint",
  3122. "type": "varchar(256)",
  3123. "primaryKey": false,
  3124. "notNull": false
  3125. },
  3126. "api_type": {
  3127. "name": "api_type",
  3128. "type": "varchar(20)",
  3129. "primaryKey": false,
  3130. "notNull": false
  3131. },
  3132. "session_id": {
  3133. "name": "session_id",
  3134. "type": "varchar(64)",
  3135. "primaryKey": false,
  3136. "notNull": false
  3137. },
  3138. "status_code": {
  3139. "name": "status_code",
  3140. "type": "integer",
  3141. "primaryKey": false,
  3142. "notNull": false
  3143. },
  3144. "is_success": {
  3145. "name": "is_success",
  3146. "type": "boolean",
  3147. "primaryKey": false,
  3148. "notNull": true,
  3149. "default": false
  3150. },
  3151. "blocked_by": {
  3152. "name": "blocked_by",
  3153. "type": "varchar(50)",
  3154. "primaryKey": false,
  3155. "notNull": false
  3156. },
  3157. "cost_usd": {
  3158. "name": "cost_usd",
  3159. "type": "numeric(21, 15)",
  3160. "primaryKey": false,
  3161. "notNull": false,
  3162. "default": "'0'"
  3163. },
  3164. "cost_multiplier": {
  3165. "name": "cost_multiplier",
  3166. "type": "numeric(10, 4)",
  3167. "primaryKey": false,
  3168. "notNull": false
  3169. },
  3170. "input_tokens": {
  3171. "name": "input_tokens",
  3172. "type": "bigint",
  3173. "primaryKey": false,
  3174. "notNull": false
  3175. },
  3176. "output_tokens": {
  3177. "name": "output_tokens",
  3178. "type": "bigint",
  3179. "primaryKey": false,
  3180. "notNull": false
  3181. },
  3182. "cache_creation_input_tokens": {
  3183. "name": "cache_creation_input_tokens",
  3184. "type": "bigint",
  3185. "primaryKey": false,
  3186. "notNull": false
  3187. },
  3188. "cache_read_input_tokens": {
  3189. "name": "cache_read_input_tokens",
  3190. "type": "bigint",
  3191. "primaryKey": false,
  3192. "notNull": false
  3193. },
  3194. "cache_creation_5m_input_tokens": {
  3195. "name": "cache_creation_5m_input_tokens",
  3196. "type": "bigint",
  3197. "primaryKey": false,
  3198. "notNull": false
  3199. },
  3200. "cache_creation_1h_input_tokens": {
  3201. "name": "cache_creation_1h_input_tokens",
  3202. "type": "bigint",
  3203. "primaryKey": false,
  3204. "notNull": false
  3205. },
  3206. "cache_ttl_applied": {
  3207. "name": "cache_ttl_applied",
  3208. "type": "varchar(10)",
  3209. "primaryKey": false,
  3210. "notNull": false
  3211. },
  3212. "context_1m_applied": {
  3213. "name": "context_1m_applied",
  3214. "type": "boolean",
  3215. "primaryKey": false,
  3216. "notNull": false,
  3217. "default": false
  3218. },
  3219. "swap_cache_ttl_applied": {
  3220. "name": "swap_cache_ttl_applied",
  3221. "type": "boolean",
  3222. "primaryKey": false,
  3223. "notNull": false,
  3224. "default": false
  3225. },
  3226. "duration_ms": {
  3227. "name": "duration_ms",
  3228. "type": "integer",
  3229. "primaryKey": false,
  3230. "notNull": false
  3231. },
  3232. "ttfb_ms": {
  3233. "name": "ttfb_ms",
  3234. "type": "integer",
  3235. "primaryKey": false,
  3236. "notNull": false
  3237. },
  3238. "created_at": {
  3239. "name": "created_at",
  3240. "type": "timestamp with time zone",
  3241. "primaryKey": false,
  3242. "notNull": true
  3243. }
  3244. },
  3245. "indexes": {
  3246. "idx_usage_ledger_request_id": {
  3247. "name": "idx_usage_ledger_request_id",
  3248. "columns": [
  3249. {
  3250. "expression": "request_id",
  3251. "isExpression": false,
  3252. "asc": true,
  3253. "nulls": "last"
  3254. }
  3255. ],
  3256. "isUnique": true,
  3257. "concurrently": false,
  3258. "method": "btree",
  3259. "with": {}
  3260. },
  3261. "idx_usage_ledger_user_created_at": {
  3262. "name": "idx_usage_ledger_user_created_at",
  3263. "columns": [
  3264. {
  3265. "expression": "user_id",
  3266. "isExpression": false,
  3267. "asc": true,
  3268. "nulls": "last"
  3269. },
  3270. {
  3271. "expression": "created_at",
  3272. "isExpression": false,
  3273. "asc": true,
  3274. "nulls": "last"
  3275. }
  3276. ],
  3277. "isUnique": false,
  3278. "where": "\"usage_ledger\".\"blocked_by\" IS NULL",
  3279. "concurrently": false,
  3280. "method": "btree",
  3281. "with": {}
  3282. },
  3283. "idx_usage_ledger_key_created_at": {
  3284. "name": "idx_usage_ledger_key_created_at",
  3285. "columns": [
  3286. {
  3287. "expression": "key",
  3288. "isExpression": false,
  3289. "asc": true,
  3290. "nulls": "last"
  3291. },
  3292. {
  3293. "expression": "created_at",
  3294. "isExpression": false,
  3295. "asc": true,
  3296. "nulls": "last"
  3297. }
  3298. ],
  3299. "isUnique": false,
  3300. "where": "\"usage_ledger\".\"blocked_by\" IS NULL",
  3301. "concurrently": false,
  3302. "method": "btree",
  3303. "with": {}
  3304. },
  3305. "idx_usage_ledger_provider_created_at": {
  3306. "name": "idx_usage_ledger_provider_created_at",
  3307. "columns": [
  3308. {
  3309. "expression": "final_provider_id",
  3310. "isExpression": false,
  3311. "asc": true,
  3312. "nulls": "last"
  3313. },
  3314. {
  3315. "expression": "created_at",
  3316. "isExpression": false,
  3317. "asc": true,
  3318. "nulls": "last"
  3319. }
  3320. ],
  3321. "isUnique": false,
  3322. "where": "\"usage_ledger\".\"blocked_by\" IS NULL",
  3323. "concurrently": false,
  3324. "method": "btree",
  3325. "with": {}
  3326. },
  3327. "idx_usage_ledger_created_at_minute": {
  3328. "name": "idx_usage_ledger_created_at_minute",
  3329. "columns": [
  3330. {
  3331. "expression": "date_trunc('minute', \"created_at\" AT TIME ZONE 'UTC')",
  3332. "asc": true,
  3333. "isExpression": true,
  3334. "nulls": "last"
  3335. }
  3336. ],
  3337. "isUnique": false,
  3338. "concurrently": false,
  3339. "method": "btree",
  3340. "with": {}
  3341. },
  3342. "idx_usage_ledger_created_at_desc_id": {
  3343. "name": "idx_usage_ledger_created_at_desc_id",
  3344. "columns": [
  3345. {
  3346. "expression": "created_at",
  3347. "isExpression": false,
  3348. "asc": false,
  3349. "nulls": "last"
  3350. },
  3351. {
  3352. "expression": "id",
  3353. "isExpression": false,
  3354. "asc": false,
  3355. "nulls": "last"
  3356. }
  3357. ],
  3358. "isUnique": false,
  3359. "concurrently": false,
  3360. "method": "btree",
  3361. "with": {}
  3362. },
  3363. "idx_usage_ledger_session_id": {
  3364. "name": "idx_usage_ledger_session_id",
  3365. "columns": [
  3366. {
  3367. "expression": "session_id",
  3368. "isExpression": false,
  3369. "asc": true,
  3370. "nulls": "last"
  3371. }
  3372. ],
  3373. "isUnique": false,
  3374. "where": "\"usage_ledger\".\"session_id\" IS NOT NULL",
  3375. "concurrently": false,
  3376. "method": "btree",
  3377. "with": {}
  3378. },
  3379. "idx_usage_ledger_model": {
  3380. "name": "idx_usage_ledger_model",
  3381. "columns": [
  3382. {
  3383. "expression": "model",
  3384. "isExpression": false,
  3385. "asc": true,
  3386. "nulls": "last"
  3387. }
  3388. ],
  3389. "isUnique": false,
  3390. "where": "\"usage_ledger\".\"model\" IS NOT NULL",
  3391. "concurrently": false,
  3392. "method": "btree",
  3393. "with": {}
  3394. },
  3395. "idx_usage_ledger_key_cost": {
  3396. "name": "idx_usage_ledger_key_cost",
  3397. "columns": [
  3398. {
  3399. "expression": "key",
  3400. "isExpression": false,
  3401. "asc": true,
  3402. "nulls": "last"
  3403. },
  3404. {
  3405. "expression": "created_at",
  3406. "isExpression": false,
  3407. "asc": true,
  3408. "nulls": "last"
  3409. },
  3410. {
  3411. "expression": "cost_usd",
  3412. "isExpression": false,
  3413. "asc": true,
  3414. "nulls": "last"
  3415. }
  3416. ],
  3417. "isUnique": false,
  3418. "where": "\"usage_ledger\".\"blocked_by\" IS NULL",
  3419. "concurrently": false,
  3420. "method": "btree",
  3421. "with": {}
  3422. },
  3423. "idx_usage_ledger_user_cost_cover": {
  3424. "name": "idx_usage_ledger_user_cost_cover",
  3425. "columns": [
  3426. {
  3427. "expression": "user_id",
  3428. "isExpression": false,
  3429. "asc": true,
  3430. "nulls": "last"
  3431. },
  3432. {
  3433. "expression": "created_at",
  3434. "isExpression": false,
  3435. "asc": true,
  3436. "nulls": "last"
  3437. },
  3438. {
  3439. "expression": "cost_usd",
  3440. "isExpression": false,
  3441. "asc": true,
  3442. "nulls": "last"
  3443. }
  3444. ],
  3445. "isUnique": false,
  3446. "where": "\"usage_ledger\".\"blocked_by\" IS NULL",
  3447. "concurrently": false,
  3448. "method": "btree",
  3449. "with": {}
  3450. },
  3451. "idx_usage_ledger_provider_cost_cover": {
  3452. "name": "idx_usage_ledger_provider_cost_cover",
  3453. "columns": [
  3454. {
  3455. "expression": "final_provider_id",
  3456. "isExpression": false,
  3457. "asc": true,
  3458. "nulls": "last"
  3459. },
  3460. {
  3461. "expression": "created_at",
  3462. "isExpression": false,
  3463. "asc": true,
  3464. "nulls": "last"
  3465. },
  3466. {
  3467. "expression": "cost_usd",
  3468. "isExpression": false,
  3469. "asc": true,
  3470. "nulls": "last"
  3471. }
  3472. ],
  3473. "isUnique": false,
  3474. "where": "\"usage_ledger\".\"blocked_by\" IS NULL",
  3475. "concurrently": false,
  3476. "method": "btree",
  3477. "with": {}
  3478. }
  3479. },
  3480. "foreignKeys": {},
  3481. "compositePrimaryKeys": {},
  3482. "uniqueConstraints": {},
  3483. "policies": {},
  3484. "checkConstraints": {},
  3485. "isRLSEnabled": false
  3486. },
  3487. "public.users": {
  3488. "name": "users",
  3489. "schema": "",
  3490. "columns": {
  3491. "id": {
  3492. "name": "id",
  3493. "type": "serial",
  3494. "primaryKey": true,
  3495. "notNull": true
  3496. },
  3497. "name": {
  3498. "name": "name",
  3499. "type": "varchar",
  3500. "primaryKey": false,
  3501. "notNull": true
  3502. },
  3503. "description": {
  3504. "name": "description",
  3505. "type": "text",
  3506. "primaryKey": false,
  3507. "notNull": false
  3508. },
  3509. "role": {
  3510. "name": "role",
  3511. "type": "varchar",
  3512. "primaryKey": false,
  3513. "notNull": false,
  3514. "default": "'user'"
  3515. },
  3516. "rpm_limit": {
  3517. "name": "rpm_limit",
  3518. "type": "integer",
  3519. "primaryKey": false,
  3520. "notNull": false
  3521. },
  3522. "daily_limit_usd": {
  3523. "name": "daily_limit_usd",
  3524. "type": "numeric(10, 2)",
  3525. "primaryKey": false,
  3526. "notNull": false
  3527. },
  3528. "provider_group": {
  3529. "name": "provider_group",
  3530. "type": "varchar(200)",
  3531. "primaryKey": false,
  3532. "notNull": false,
  3533. "default": "'default'"
  3534. },
  3535. "tags": {
  3536. "name": "tags",
  3537. "type": "jsonb",
  3538. "primaryKey": false,
  3539. "notNull": false,
  3540. "default": "'[]'::jsonb"
  3541. },
  3542. "limit_5h_usd": {
  3543. "name": "limit_5h_usd",
  3544. "type": "numeric(10, 2)",
  3545. "primaryKey": false,
  3546. "notNull": false
  3547. },
  3548. "limit_weekly_usd": {
  3549. "name": "limit_weekly_usd",
  3550. "type": "numeric(10, 2)",
  3551. "primaryKey": false,
  3552. "notNull": false
  3553. },
  3554. "limit_monthly_usd": {
  3555. "name": "limit_monthly_usd",
  3556. "type": "numeric(10, 2)",
  3557. "primaryKey": false,
  3558. "notNull": false
  3559. },
  3560. "limit_total_usd": {
  3561. "name": "limit_total_usd",
  3562. "type": "numeric(10, 2)",
  3563. "primaryKey": false,
  3564. "notNull": false
  3565. },
  3566. "limit_concurrent_sessions": {
  3567. "name": "limit_concurrent_sessions",
  3568. "type": "integer",
  3569. "primaryKey": false,
  3570. "notNull": false
  3571. },
  3572. "daily_reset_mode": {
  3573. "name": "daily_reset_mode",
  3574. "type": "daily_reset_mode",
  3575. "typeSchema": "public",
  3576. "primaryKey": false,
  3577. "notNull": true,
  3578. "default": "'fixed'"
  3579. },
  3580. "daily_reset_time": {
  3581. "name": "daily_reset_time",
  3582. "type": "varchar(5)",
  3583. "primaryKey": false,
  3584. "notNull": true,
  3585. "default": "'00:00'"
  3586. },
  3587. "is_enabled": {
  3588. "name": "is_enabled",
  3589. "type": "boolean",
  3590. "primaryKey": false,
  3591. "notNull": true,
  3592. "default": true
  3593. },
  3594. "expires_at": {
  3595. "name": "expires_at",
  3596. "type": "timestamp with time zone",
  3597. "primaryKey": false,
  3598. "notNull": false
  3599. },
  3600. "allowed_clients": {
  3601. "name": "allowed_clients",
  3602. "type": "jsonb",
  3603. "primaryKey": false,
  3604. "notNull": false,
  3605. "default": "'[]'::jsonb"
  3606. },
  3607. "allowed_models": {
  3608. "name": "allowed_models",
  3609. "type": "jsonb",
  3610. "primaryKey": false,
  3611. "notNull": false,
  3612. "default": "'[]'::jsonb"
  3613. },
  3614. "blocked_clients": {
  3615. "name": "blocked_clients",
  3616. "type": "jsonb",
  3617. "primaryKey": false,
  3618. "notNull": true,
  3619. "default": "'[]'::jsonb"
  3620. },
  3621. "created_at": {
  3622. "name": "created_at",
  3623. "type": "timestamp with time zone",
  3624. "primaryKey": false,
  3625. "notNull": false,
  3626. "default": "now()"
  3627. },
  3628. "updated_at": {
  3629. "name": "updated_at",
  3630. "type": "timestamp with time zone",
  3631. "primaryKey": false,
  3632. "notNull": false,
  3633. "default": "now()"
  3634. },
  3635. "deleted_at": {
  3636. "name": "deleted_at",
  3637. "type": "timestamp with time zone",
  3638. "primaryKey": false,
  3639. "notNull": false
  3640. }
  3641. },
  3642. "indexes": {
  3643. "idx_users_active_role_sort": {
  3644. "name": "idx_users_active_role_sort",
  3645. "columns": [
  3646. {
  3647. "expression": "deleted_at",
  3648. "isExpression": false,
  3649. "asc": true,
  3650. "nulls": "last"
  3651. },
  3652. {
  3653. "expression": "role",
  3654. "isExpression": false,
  3655. "asc": true,
  3656. "nulls": "last"
  3657. },
  3658. {
  3659. "expression": "id",
  3660. "isExpression": false,
  3661. "asc": true,
  3662. "nulls": "last"
  3663. }
  3664. ],
  3665. "isUnique": false,
  3666. "where": "\"users\".\"deleted_at\" IS NULL",
  3667. "concurrently": false,
  3668. "method": "btree",
  3669. "with": {}
  3670. },
  3671. "idx_users_enabled_expires_at": {
  3672. "name": "idx_users_enabled_expires_at",
  3673. "columns": [
  3674. {
  3675. "expression": "is_enabled",
  3676. "isExpression": false,
  3677. "asc": true,
  3678. "nulls": "last"
  3679. },
  3680. {
  3681. "expression": "expires_at",
  3682. "isExpression": false,
  3683. "asc": true,
  3684. "nulls": "last"
  3685. }
  3686. ],
  3687. "isUnique": false,
  3688. "where": "\"users\".\"deleted_at\" IS NULL",
  3689. "concurrently": false,
  3690. "method": "btree",
  3691. "with": {}
  3692. },
  3693. "idx_users_tags_gin": {
  3694. "name": "idx_users_tags_gin",
  3695. "columns": [
  3696. {
  3697. "expression": "tags",
  3698. "isExpression": false,
  3699. "asc": true,
  3700. "nulls": "last"
  3701. }
  3702. ],
  3703. "isUnique": false,
  3704. "where": "\"users\".\"deleted_at\" IS NULL",
  3705. "concurrently": false,
  3706. "method": "gin",
  3707. "with": {}
  3708. },
  3709. "idx_users_created_at": {
  3710. "name": "idx_users_created_at",
  3711. "columns": [
  3712. {
  3713. "expression": "created_at",
  3714. "isExpression": false,
  3715. "asc": true,
  3716. "nulls": "last"
  3717. }
  3718. ],
  3719. "isUnique": false,
  3720. "concurrently": false,
  3721. "method": "btree",
  3722. "with": {}
  3723. },
  3724. "idx_users_deleted_at": {
  3725. "name": "idx_users_deleted_at",
  3726. "columns": [
  3727. {
  3728. "expression": "deleted_at",
  3729. "isExpression": false,
  3730. "asc": true,
  3731. "nulls": "last"
  3732. }
  3733. ],
  3734. "isUnique": false,
  3735. "concurrently": false,
  3736. "method": "btree",
  3737. "with": {}
  3738. }
  3739. },
  3740. "foreignKeys": {},
  3741. "compositePrimaryKeys": {},
  3742. "uniqueConstraints": {},
  3743. "policies": {},
  3744. "checkConstraints": {},
  3745. "isRLSEnabled": false
  3746. },
  3747. "public.webhook_targets": {
  3748. "name": "webhook_targets",
  3749. "schema": "",
  3750. "columns": {
  3751. "id": {
  3752. "name": "id",
  3753. "type": "serial",
  3754. "primaryKey": true,
  3755. "notNull": true
  3756. },
  3757. "name": {
  3758. "name": "name",
  3759. "type": "varchar(100)",
  3760. "primaryKey": false,
  3761. "notNull": true
  3762. },
  3763. "provider_type": {
  3764. "name": "provider_type",
  3765. "type": "webhook_provider_type",
  3766. "typeSchema": "public",
  3767. "primaryKey": false,
  3768. "notNull": true
  3769. },
  3770. "webhook_url": {
  3771. "name": "webhook_url",
  3772. "type": "varchar(1024)",
  3773. "primaryKey": false,
  3774. "notNull": false
  3775. },
  3776. "telegram_bot_token": {
  3777. "name": "telegram_bot_token",
  3778. "type": "varchar(256)",
  3779. "primaryKey": false,
  3780. "notNull": false
  3781. },
  3782. "telegram_chat_id": {
  3783. "name": "telegram_chat_id",
  3784. "type": "varchar(64)",
  3785. "primaryKey": false,
  3786. "notNull": false
  3787. },
  3788. "dingtalk_secret": {
  3789. "name": "dingtalk_secret",
  3790. "type": "varchar(256)",
  3791. "primaryKey": false,
  3792. "notNull": false
  3793. },
  3794. "custom_template": {
  3795. "name": "custom_template",
  3796. "type": "jsonb",
  3797. "primaryKey": false,
  3798. "notNull": false
  3799. },
  3800. "custom_headers": {
  3801. "name": "custom_headers",
  3802. "type": "jsonb",
  3803. "primaryKey": false,
  3804. "notNull": false
  3805. },
  3806. "proxy_url": {
  3807. "name": "proxy_url",
  3808. "type": "varchar(512)",
  3809. "primaryKey": false,
  3810. "notNull": false
  3811. },
  3812. "proxy_fallback_to_direct": {
  3813. "name": "proxy_fallback_to_direct",
  3814. "type": "boolean",
  3815. "primaryKey": false,
  3816. "notNull": false,
  3817. "default": false
  3818. },
  3819. "is_enabled": {
  3820. "name": "is_enabled",
  3821. "type": "boolean",
  3822. "primaryKey": false,
  3823. "notNull": true,
  3824. "default": true
  3825. },
  3826. "last_test_at": {
  3827. "name": "last_test_at",
  3828. "type": "timestamp with time zone",
  3829. "primaryKey": false,
  3830. "notNull": false
  3831. },
  3832. "last_test_result": {
  3833. "name": "last_test_result",
  3834. "type": "jsonb",
  3835. "primaryKey": false,
  3836. "notNull": false
  3837. },
  3838. "created_at": {
  3839. "name": "created_at",
  3840. "type": "timestamp with time zone",
  3841. "primaryKey": false,
  3842. "notNull": false,
  3843. "default": "now()"
  3844. },
  3845. "updated_at": {
  3846. "name": "updated_at",
  3847. "type": "timestamp with time zone",
  3848. "primaryKey": false,
  3849. "notNull": false,
  3850. "default": "now()"
  3851. }
  3852. },
  3853. "indexes": {},
  3854. "foreignKeys": {},
  3855. "compositePrimaryKeys": {},
  3856. "uniqueConstraints": {},
  3857. "policies": {},
  3858. "checkConstraints": {},
  3859. "isRLSEnabled": false
  3860. }
  3861. },
  3862. "enums": {
  3863. "public.daily_reset_mode": {
  3864. "name": "daily_reset_mode",
  3865. "schema": "public",
  3866. "values": [
  3867. "fixed",
  3868. "rolling"
  3869. ]
  3870. },
  3871. "public.notification_type": {
  3872. "name": "notification_type",
  3873. "schema": "public",
  3874. "values": [
  3875. "circuit_breaker",
  3876. "daily_leaderboard",
  3877. "cost_alert",
  3878. "cache_hit_rate_alert"
  3879. ]
  3880. },
  3881. "public.webhook_provider_type": {
  3882. "name": "webhook_provider_type",
  3883. "schema": "public",
  3884. "values": [
  3885. "wechat",
  3886. "feishu",
  3887. "dingtalk",
  3888. "telegram",
  3889. "custom"
  3890. ]
  3891. }
  3892. },
  3893. "schemas": {},
  3894. "sequences": {},
  3895. "roles": {},
  3896. "policies": {},
  3897. "views": {},
  3898. "_meta": {
  3899. "columns": {},
  3900. "schemas": {},
  3901. "tables": {}
  3902. }
  3903. }