0081_snapshot.json 109 KB

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