0086_snapshot.json 110 KB

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