0084_snapshot.json 110 KB

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