0018_snapshot.json 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500
  1. {
  2. "id": "dcbbb4ef-507a-41b9-81e6-ebd68d37dad8",
  3. "prevId": "f68e89cc-aedd-4df1-a470-4081b0a18fb5",
  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. "is_enabled": {
  43. "name": "is_enabled",
  44. "type": "boolean",
  45. "primaryKey": false,
  46. "notNull": true,
  47. "default": true
  48. },
  49. "is_default": {
  50. "name": "is_default",
  51. "type": "boolean",
  52. "primaryKey": false,
  53. "notNull": true,
  54. "default": false
  55. },
  56. "priority": {
  57. "name": "priority",
  58. "type": "integer",
  59. "primaryKey": false,
  60. "notNull": true,
  61. "default": 0
  62. },
  63. "created_at": {
  64. "name": "created_at",
  65. "type": "timestamp with time zone",
  66. "primaryKey": false,
  67. "notNull": false,
  68. "default": "now()"
  69. },
  70. "updated_at": {
  71. "name": "updated_at",
  72. "type": "timestamp with time zone",
  73. "primaryKey": false,
  74. "notNull": false,
  75. "default": "now()"
  76. }
  77. },
  78. "indexes": {
  79. "idx_error_rules_enabled": {
  80. "name": "idx_error_rules_enabled",
  81. "columns": [
  82. {
  83. "expression": "is_enabled",
  84. "isExpression": false,
  85. "asc": true,
  86. "nulls": "last"
  87. },
  88. {
  89. "expression": "priority",
  90. "isExpression": false,
  91. "asc": true,
  92. "nulls": "last"
  93. }
  94. ],
  95. "isUnique": false,
  96. "concurrently": false,
  97. "method": "btree",
  98. "with": {}
  99. },
  100. "unique_pattern": {
  101. "name": "unique_pattern",
  102. "columns": [
  103. {
  104. "expression": "pattern",
  105. "isExpression": false,
  106. "asc": true,
  107. "nulls": "last"
  108. }
  109. ],
  110. "isUnique": true,
  111. "concurrently": false,
  112. "method": "btree",
  113. "with": {}
  114. },
  115. "idx_category": {
  116. "name": "idx_category",
  117. "columns": [
  118. {
  119. "expression": "category",
  120. "isExpression": false,
  121. "asc": true,
  122. "nulls": "last"
  123. }
  124. ],
  125. "isUnique": false,
  126. "concurrently": false,
  127. "method": "btree",
  128. "with": {}
  129. },
  130. "idx_match_type": {
  131. "name": "idx_match_type",
  132. "columns": [
  133. {
  134. "expression": "match_type",
  135. "isExpression": false,
  136. "asc": true,
  137. "nulls": "last"
  138. }
  139. ],
  140. "isUnique": false,
  141. "concurrently": false,
  142. "method": "btree",
  143. "with": {}
  144. }
  145. },
  146. "foreignKeys": {},
  147. "compositePrimaryKeys": {},
  148. "uniqueConstraints": {},
  149. "policies": {},
  150. "checkConstraints": {},
  151. "isRLSEnabled": false
  152. },
  153. "public.keys": {
  154. "name": "keys",
  155. "schema": "",
  156. "columns": {
  157. "id": {
  158. "name": "id",
  159. "type": "serial",
  160. "primaryKey": true,
  161. "notNull": true
  162. },
  163. "user_id": {
  164. "name": "user_id",
  165. "type": "integer",
  166. "primaryKey": false,
  167. "notNull": true
  168. },
  169. "key": {
  170. "name": "key",
  171. "type": "varchar",
  172. "primaryKey": false,
  173. "notNull": true
  174. },
  175. "name": {
  176. "name": "name",
  177. "type": "varchar",
  178. "primaryKey": false,
  179. "notNull": true
  180. },
  181. "is_enabled": {
  182. "name": "is_enabled",
  183. "type": "boolean",
  184. "primaryKey": false,
  185. "notNull": false,
  186. "default": true
  187. },
  188. "expires_at": {
  189. "name": "expires_at",
  190. "type": "timestamp",
  191. "primaryKey": false,
  192. "notNull": false
  193. },
  194. "can_login_web_ui": {
  195. "name": "can_login_web_ui",
  196. "type": "boolean",
  197. "primaryKey": false,
  198. "notNull": false,
  199. "default": true
  200. },
  201. "limit_5h_usd": {
  202. "name": "limit_5h_usd",
  203. "type": "numeric(10, 2)",
  204. "primaryKey": false,
  205. "notNull": false
  206. },
  207. "limit_daily_usd": {
  208. "name": "limit_daily_usd",
  209. "type": "numeric(10, 2)",
  210. "primaryKey": false,
  211. "notNull": false
  212. },
  213. "daily_reset_time": {
  214. "name": "daily_reset_time",
  215. "type": "varchar(5)",
  216. "primaryKey": false,
  217. "notNull": false,
  218. "default": "'00:00'"
  219. },
  220. "limit_weekly_usd": {
  221. "name": "limit_weekly_usd",
  222. "type": "numeric(10, 2)",
  223. "primaryKey": false,
  224. "notNull": false
  225. },
  226. "limit_monthly_usd": {
  227. "name": "limit_monthly_usd",
  228. "type": "numeric(10, 2)",
  229. "primaryKey": false,
  230. "notNull": false
  231. },
  232. "limit_concurrent_sessions": {
  233. "name": "limit_concurrent_sessions",
  234. "type": "integer",
  235. "primaryKey": false,
  236. "notNull": false,
  237. "default": 0
  238. },
  239. "created_at": {
  240. "name": "created_at",
  241. "type": "timestamp with time zone",
  242. "primaryKey": false,
  243. "notNull": false,
  244. "default": "now()"
  245. },
  246. "updated_at": {
  247. "name": "updated_at",
  248. "type": "timestamp with time zone",
  249. "primaryKey": false,
  250. "notNull": false,
  251. "default": "now()"
  252. },
  253. "deleted_at": {
  254. "name": "deleted_at",
  255. "type": "timestamp with time zone",
  256. "primaryKey": false,
  257. "notNull": false
  258. }
  259. },
  260. "indexes": {
  261. "idx_keys_user_id": {
  262. "name": "idx_keys_user_id",
  263. "columns": [
  264. {
  265. "expression": "user_id",
  266. "isExpression": false,
  267. "asc": true,
  268. "nulls": "last"
  269. }
  270. ],
  271. "isUnique": false,
  272. "concurrently": false,
  273. "method": "btree",
  274. "with": {}
  275. },
  276. "idx_keys_created_at": {
  277. "name": "idx_keys_created_at",
  278. "columns": [
  279. {
  280. "expression": "created_at",
  281. "isExpression": false,
  282. "asc": true,
  283. "nulls": "last"
  284. }
  285. ],
  286. "isUnique": false,
  287. "concurrently": false,
  288. "method": "btree",
  289. "with": {}
  290. },
  291. "idx_keys_deleted_at": {
  292. "name": "idx_keys_deleted_at",
  293. "columns": [
  294. {
  295. "expression": "deleted_at",
  296. "isExpression": false,
  297. "asc": true,
  298. "nulls": "last"
  299. }
  300. ],
  301. "isUnique": false,
  302. "concurrently": false,
  303. "method": "btree",
  304. "with": {}
  305. }
  306. },
  307. "foreignKeys": {},
  308. "compositePrimaryKeys": {},
  309. "uniqueConstraints": {},
  310. "policies": {},
  311. "checkConstraints": {},
  312. "isRLSEnabled": false
  313. },
  314. "public.message_request": {
  315. "name": "message_request",
  316. "schema": "",
  317. "columns": {
  318. "id": {
  319. "name": "id",
  320. "type": "serial",
  321. "primaryKey": true,
  322. "notNull": true
  323. },
  324. "provider_id": {
  325. "name": "provider_id",
  326. "type": "integer",
  327. "primaryKey": false,
  328. "notNull": true
  329. },
  330. "user_id": {
  331. "name": "user_id",
  332. "type": "integer",
  333. "primaryKey": false,
  334. "notNull": true
  335. },
  336. "key": {
  337. "name": "key",
  338. "type": "varchar",
  339. "primaryKey": false,
  340. "notNull": true
  341. },
  342. "model": {
  343. "name": "model",
  344. "type": "varchar(128)",
  345. "primaryKey": false,
  346. "notNull": false
  347. },
  348. "duration_ms": {
  349. "name": "duration_ms",
  350. "type": "integer",
  351. "primaryKey": false,
  352. "notNull": false
  353. },
  354. "cost_usd": {
  355. "name": "cost_usd",
  356. "type": "numeric(21, 15)",
  357. "primaryKey": false,
  358. "notNull": false,
  359. "default": "'0'"
  360. },
  361. "cost_multiplier": {
  362. "name": "cost_multiplier",
  363. "type": "numeric(10, 4)",
  364. "primaryKey": false,
  365. "notNull": false
  366. },
  367. "session_id": {
  368. "name": "session_id",
  369. "type": "varchar(64)",
  370. "primaryKey": false,
  371. "notNull": false
  372. },
  373. "provider_chain": {
  374. "name": "provider_chain",
  375. "type": "jsonb",
  376. "primaryKey": false,
  377. "notNull": false
  378. },
  379. "status_code": {
  380. "name": "status_code",
  381. "type": "integer",
  382. "primaryKey": false,
  383. "notNull": false
  384. },
  385. "api_type": {
  386. "name": "api_type",
  387. "type": "varchar(20)",
  388. "primaryKey": false,
  389. "notNull": false
  390. },
  391. "endpoint": {
  392. "name": "endpoint",
  393. "type": "varchar(256)",
  394. "primaryKey": false,
  395. "notNull": false
  396. },
  397. "original_model": {
  398. "name": "original_model",
  399. "type": "varchar(128)",
  400. "primaryKey": false,
  401. "notNull": false
  402. },
  403. "input_tokens": {
  404. "name": "input_tokens",
  405. "type": "integer",
  406. "primaryKey": false,
  407. "notNull": false
  408. },
  409. "output_tokens": {
  410. "name": "output_tokens",
  411. "type": "integer",
  412. "primaryKey": false,
  413. "notNull": false
  414. },
  415. "cache_creation_input_tokens": {
  416. "name": "cache_creation_input_tokens",
  417. "type": "integer",
  418. "primaryKey": false,
  419. "notNull": false
  420. },
  421. "cache_read_input_tokens": {
  422. "name": "cache_read_input_tokens",
  423. "type": "integer",
  424. "primaryKey": false,
  425. "notNull": false
  426. },
  427. "error_message": {
  428. "name": "error_message",
  429. "type": "text",
  430. "primaryKey": false,
  431. "notNull": false
  432. },
  433. "blocked_by": {
  434. "name": "blocked_by",
  435. "type": "varchar(50)",
  436. "primaryKey": false,
  437. "notNull": false
  438. },
  439. "blocked_reason": {
  440. "name": "blocked_reason",
  441. "type": "text",
  442. "primaryKey": false,
  443. "notNull": false
  444. },
  445. "user_agent": {
  446. "name": "user_agent",
  447. "type": "varchar(512)",
  448. "primaryKey": false,
  449. "notNull": false
  450. },
  451. "messages_count": {
  452. "name": "messages_count",
  453. "type": "integer",
  454. "primaryKey": false,
  455. "notNull": false
  456. },
  457. "created_at": {
  458. "name": "created_at",
  459. "type": "timestamp with time zone",
  460. "primaryKey": false,
  461. "notNull": false,
  462. "default": "now()"
  463. },
  464. "updated_at": {
  465. "name": "updated_at",
  466. "type": "timestamp with time zone",
  467. "primaryKey": false,
  468. "notNull": false,
  469. "default": "now()"
  470. },
  471. "deleted_at": {
  472. "name": "deleted_at",
  473. "type": "timestamp with time zone",
  474. "primaryKey": false,
  475. "notNull": false
  476. }
  477. },
  478. "indexes": {
  479. "idx_message_request_user_date_cost": {
  480. "name": "idx_message_request_user_date_cost",
  481. "columns": [
  482. {
  483. "expression": "user_id",
  484. "isExpression": false,
  485. "asc": true,
  486. "nulls": "last"
  487. },
  488. {
  489. "expression": "created_at",
  490. "isExpression": false,
  491. "asc": true,
  492. "nulls": "last"
  493. },
  494. {
  495. "expression": "cost_usd",
  496. "isExpression": false,
  497. "asc": true,
  498. "nulls": "last"
  499. }
  500. ],
  501. "isUnique": false,
  502. "where": "\"message_request\".\"deleted_at\" IS NULL",
  503. "concurrently": false,
  504. "method": "btree",
  505. "with": {}
  506. },
  507. "idx_message_request_user_query": {
  508. "name": "idx_message_request_user_query",
  509. "columns": [
  510. {
  511. "expression": "user_id",
  512. "isExpression": false,
  513. "asc": true,
  514. "nulls": "last"
  515. },
  516. {
  517. "expression": "created_at",
  518. "isExpression": false,
  519. "asc": true,
  520. "nulls": "last"
  521. }
  522. ],
  523. "isUnique": false,
  524. "where": "\"message_request\".\"deleted_at\" IS NULL",
  525. "concurrently": false,
  526. "method": "btree",
  527. "with": {}
  528. },
  529. "idx_message_request_session_id": {
  530. "name": "idx_message_request_session_id",
  531. "columns": [
  532. {
  533. "expression": "session_id",
  534. "isExpression": false,
  535. "asc": true,
  536. "nulls": "last"
  537. }
  538. ],
  539. "isUnique": false,
  540. "where": "\"message_request\".\"deleted_at\" IS NULL",
  541. "concurrently": false,
  542. "method": "btree",
  543. "with": {}
  544. },
  545. "idx_message_request_endpoint": {
  546. "name": "idx_message_request_endpoint",
  547. "columns": [
  548. {
  549. "expression": "endpoint",
  550. "isExpression": false,
  551. "asc": true,
  552. "nulls": "last"
  553. }
  554. ],
  555. "isUnique": false,
  556. "where": "\"message_request\".\"deleted_at\" IS NULL",
  557. "concurrently": false,
  558. "method": "btree",
  559. "with": {}
  560. },
  561. "idx_message_request_provider_id": {
  562. "name": "idx_message_request_provider_id",
  563. "columns": [
  564. {
  565. "expression": "provider_id",
  566. "isExpression": false,
  567. "asc": true,
  568. "nulls": "last"
  569. }
  570. ],
  571. "isUnique": false,
  572. "concurrently": false,
  573. "method": "btree",
  574. "with": {}
  575. },
  576. "idx_message_request_user_id": {
  577. "name": "idx_message_request_user_id",
  578. "columns": [
  579. {
  580. "expression": "user_id",
  581. "isExpression": false,
  582. "asc": true,
  583. "nulls": "last"
  584. }
  585. ],
  586. "isUnique": false,
  587. "concurrently": false,
  588. "method": "btree",
  589. "with": {}
  590. },
  591. "idx_message_request_key": {
  592. "name": "idx_message_request_key",
  593. "columns": [
  594. {
  595. "expression": "key",
  596. "isExpression": false,
  597. "asc": true,
  598. "nulls": "last"
  599. }
  600. ],
  601. "isUnique": false,
  602. "concurrently": false,
  603. "method": "btree",
  604. "with": {}
  605. },
  606. "idx_message_request_created_at": {
  607. "name": "idx_message_request_created_at",
  608. "columns": [
  609. {
  610. "expression": "created_at",
  611. "isExpression": false,
  612. "asc": true,
  613. "nulls": "last"
  614. }
  615. ],
  616. "isUnique": false,
  617. "concurrently": false,
  618. "method": "btree",
  619. "with": {}
  620. },
  621. "idx_message_request_deleted_at": {
  622. "name": "idx_message_request_deleted_at",
  623. "columns": [
  624. {
  625. "expression": "deleted_at",
  626. "isExpression": false,
  627. "asc": true,
  628. "nulls": "last"
  629. }
  630. ],
  631. "isUnique": false,
  632. "concurrently": false,
  633. "method": "btree",
  634. "with": {}
  635. }
  636. },
  637. "foreignKeys": {},
  638. "compositePrimaryKeys": {},
  639. "uniqueConstraints": {},
  640. "policies": {},
  641. "checkConstraints": {},
  642. "isRLSEnabled": false
  643. },
  644. "public.model_prices": {
  645. "name": "model_prices",
  646. "schema": "",
  647. "columns": {
  648. "id": {
  649. "name": "id",
  650. "type": "serial",
  651. "primaryKey": true,
  652. "notNull": true
  653. },
  654. "model_name": {
  655. "name": "model_name",
  656. "type": "varchar",
  657. "primaryKey": false,
  658. "notNull": true
  659. },
  660. "price_data": {
  661. "name": "price_data",
  662. "type": "jsonb",
  663. "primaryKey": false,
  664. "notNull": true
  665. },
  666. "created_at": {
  667. "name": "created_at",
  668. "type": "timestamp with time zone",
  669. "primaryKey": false,
  670. "notNull": false,
  671. "default": "now()"
  672. },
  673. "updated_at": {
  674. "name": "updated_at",
  675. "type": "timestamp with time zone",
  676. "primaryKey": false,
  677. "notNull": false,
  678. "default": "now()"
  679. }
  680. },
  681. "indexes": {
  682. "idx_model_prices_latest": {
  683. "name": "idx_model_prices_latest",
  684. "columns": [
  685. {
  686. "expression": "model_name",
  687. "isExpression": false,
  688. "asc": true,
  689. "nulls": "last"
  690. },
  691. {
  692. "expression": "created_at",
  693. "isExpression": false,
  694. "asc": false,
  695. "nulls": "last"
  696. }
  697. ],
  698. "isUnique": false,
  699. "concurrently": false,
  700. "method": "btree",
  701. "with": {}
  702. },
  703. "idx_model_prices_model_name": {
  704. "name": "idx_model_prices_model_name",
  705. "columns": [
  706. {
  707. "expression": "model_name",
  708. "isExpression": false,
  709. "asc": true,
  710. "nulls": "last"
  711. }
  712. ],
  713. "isUnique": false,
  714. "concurrently": false,
  715. "method": "btree",
  716. "with": {}
  717. },
  718. "idx_model_prices_created_at": {
  719. "name": "idx_model_prices_created_at",
  720. "columns": [
  721. {
  722. "expression": "created_at",
  723. "isExpression": false,
  724. "asc": false,
  725. "nulls": "last"
  726. }
  727. ],
  728. "isUnique": false,
  729. "concurrently": false,
  730. "method": "btree",
  731. "with": {}
  732. }
  733. },
  734. "foreignKeys": {},
  735. "compositePrimaryKeys": {},
  736. "uniqueConstraints": {},
  737. "policies": {},
  738. "checkConstraints": {},
  739. "isRLSEnabled": false
  740. },
  741. "public.notification_settings": {
  742. "name": "notification_settings",
  743. "schema": "",
  744. "columns": {
  745. "id": {
  746. "name": "id",
  747. "type": "serial",
  748. "primaryKey": true,
  749. "notNull": true
  750. },
  751. "enabled": {
  752. "name": "enabled",
  753. "type": "boolean",
  754. "primaryKey": false,
  755. "notNull": true,
  756. "default": false
  757. },
  758. "circuit_breaker_enabled": {
  759. "name": "circuit_breaker_enabled",
  760. "type": "boolean",
  761. "primaryKey": false,
  762. "notNull": true,
  763. "default": false
  764. },
  765. "circuit_breaker_webhook": {
  766. "name": "circuit_breaker_webhook",
  767. "type": "varchar(512)",
  768. "primaryKey": false,
  769. "notNull": false
  770. },
  771. "daily_leaderboard_enabled": {
  772. "name": "daily_leaderboard_enabled",
  773. "type": "boolean",
  774. "primaryKey": false,
  775. "notNull": true,
  776. "default": false
  777. },
  778. "daily_leaderboard_webhook": {
  779. "name": "daily_leaderboard_webhook",
  780. "type": "varchar(512)",
  781. "primaryKey": false,
  782. "notNull": false
  783. },
  784. "daily_leaderboard_time": {
  785. "name": "daily_leaderboard_time",
  786. "type": "varchar(10)",
  787. "primaryKey": false,
  788. "notNull": false,
  789. "default": "'09:00'"
  790. },
  791. "daily_leaderboard_top_n": {
  792. "name": "daily_leaderboard_top_n",
  793. "type": "integer",
  794. "primaryKey": false,
  795. "notNull": false,
  796. "default": 5
  797. },
  798. "cost_alert_enabled": {
  799. "name": "cost_alert_enabled",
  800. "type": "boolean",
  801. "primaryKey": false,
  802. "notNull": true,
  803. "default": false
  804. },
  805. "cost_alert_webhook": {
  806. "name": "cost_alert_webhook",
  807. "type": "varchar(512)",
  808. "primaryKey": false,
  809. "notNull": false
  810. },
  811. "cost_alert_threshold": {
  812. "name": "cost_alert_threshold",
  813. "type": "numeric(5, 2)",
  814. "primaryKey": false,
  815. "notNull": false,
  816. "default": "'0.80'"
  817. },
  818. "cost_alert_check_interval": {
  819. "name": "cost_alert_check_interval",
  820. "type": "integer",
  821. "primaryKey": false,
  822. "notNull": false,
  823. "default": 60
  824. },
  825. "created_at": {
  826. "name": "created_at",
  827. "type": "timestamp with time zone",
  828. "primaryKey": false,
  829. "notNull": false,
  830. "default": "now()"
  831. },
  832. "updated_at": {
  833. "name": "updated_at",
  834. "type": "timestamp with time zone",
  835. "primaryKey": false,
  836. "notNull": false,
  837. "default": "now()"
  838. }
  839. },
  840. "indexes": {},
  841. "foreignKeys": {},
  842. "compositePrimaryKeys": {},
  843. "uniqueConstraints": {},
  844. "policies": {},
  845. "checkConstraints": {},
  846. "isRLSEnabled": false
  847. },
  848. "public.providers": {
  849. "name": "providers",
  850. "schema": "",
  851. "columns": {
  852. "id": {
  853. "name": "id",
  854. "type": "serial",
  855. "primaryKey": true,
  856. "notNull": true
  857. },
  858. "name": {
  859. "name": "name",
  860. "type": "varchar",
  861. "primaryKey": false,
  862. "notNull": true
  863. },
  864. "description": {
  865. "name": "description",
  866. "type": "text",
  867. "primaryKey": false,
  868. "notNull": false
  869. },
  870. "url": {
  871. "name": "url",
  872. "type": "varchar",
  873. "primaryKey": false,
  874. "notNull": true
  875. },
  876. "key": {
  877. "name": "key",
  878. "type": "varchar",
  879. "primaryKey": false,
  880. "notNull": true
  881. },
  882. "is_enabled": {
  883. "name": "is_enabled",
  884. "type": "boolean",
  885. "primaryKey": false,
  886. "notNull": true,
  887. "default": true
  888. },
  889. "weight": {
  890. "name": "weight",
  891. "type": "integer",
  892. "primaryKey": false,
  893. "notNull": true,
  894. "default": 1
  895. },
  896. "priority": {
  897. "name": "priority",
  898. "type": "integer",
  899. "primaryKey": false,
  900. "notNull": true,
  901. "default": 0
  902. },
  903. "cost_multiplier": {
  904. "name": "cost_multiplier",
  905. "type": "numeric(10, 4)",
  906. "primaryKey": false,
  907. "notNull": false,
  908. "default": "'1.0'"
  909. },
  910. "group_tag": {
  911. "name": "group_tag",
  912. "type": "varchar(50)",
  913. "primaryKey": false,
  914. "notNull": false
  915. },
  916. "provider_type": {
  917. "name": "provider_type",
  918. "type": "varchar(20)",
  919. "primaryKey": false,
  920. "notNull": true,
  921. "default": "'claude'"
  922. },
  923. "model_redirects": {
  924. "name": "model_redirects",
  925. "type": "jsonb",
  926. "primaryKey": false,
  927. "notNull": false
  928. },
  929. "allowed_models": {
  930. "name": "allowed_models",
  931. "type": "jsonb",
  932. "primaryKey": false,
  933. "notNull": false,
  934. "default": "'null'::jsonb"
  935. },
  936. "join_claude_pool": {
  937. "name": "join_claude_pool",
  938. "type": "boolean",
  939. "primaryKey": false,
  940. "notNull": false,
  941. "default": false
  942. },
  943. "codex_instructions_strategy": {
  944. "name": "codex_instructions_strategy",
  945. "type": "varchar(20)",
  946. "primaryKey": false,
  947. "notNull": false,
  948. "default": "'auto'"
  949. },
  950. "limit_5h_usd": {
  951. "name": "limit_5h_usd",
  952. "type": "numeric(10, 2)",
  953. "primaryKey": false,
  954. "notNull": false
  955. },
  956. "limit_daily_usd": {
  957. "name": "limit_daily_usd",
  958. "type": "numeric(10, 2)",
  959. "primaryKey": false,
  960. "notNull": false
  961. },
  962. "daily_reset_time": {
  963. "name": "daily_reset_time",
  964. "type": "varchar(5)",
  965. "primaryKey": false,
  966. "notNull": false,
  967. "default": "'00:00'"
  968. },
  969. "limit_weekly_usd": {
  970. "name": "limit_weekly_usd",
  971. "type": "numeric(10, 2)",
  972. "primaryKey": false,
  973. "notNull": false
  974. },
  975. "limit_monthly_usd": {
  976. "name": "limit_monthly_usd",
  977. "type": "numeric(10, 2)",
  978. "primaryKey": false,
  979. "notNull": false
  980. },
  981. "limit_concurrent_sessions": {
  982. "name": "limit_concurrent_sessions",
  983. "type": "integer",
  984. "primaryKey": false,
  985. "notNull": false,
  986. "default": 0
  987. },
  988. "circuit_breaker_failure_threshold": {
  989. "name": "circuit_breaker_failure_threshold",
  990. "type": "integer",
  991. "primaryKey": false,
  992. "notNull": false,
  993. "default": 5
  994. },
  995. "circuit_breaker_open_duration": {
  996. "name": "circuit_breaker_open_duration",
  997. "type": "integer",
  998. "primaryKey": false,
  999. "notNull": false,
  1000. "default": 1800000
  1001. },
  1002. "circuit_breaker_half_open_success_threshold": {
  1003. "name": "circuit_breaker_half_open_success_threshold",
  1004. "type": "integer",
  1005. "primaryKey": false,
  1006. "notNull": false,
  1007. "default": 2
  1008. },
  1009. "proxy_url": {
  1010. "name": "proxy_url",
  1011. "type": "varchar(512)",
  1012. "primaryKey": false,
  1013. "notNull": false
  1014. },
  1015. "proxy_fallback_to_direct": {
  1016. "name": "proxy_fallback_to_direct",
  1017. "type": "boolean",
  1018. "primaryKey": false,
  1019. "notNull": false,
  1020. "default": false
  1021. },
  1022. "website_url": {
  1023. "name": "website_url",
  1024. "type": "text",
  1025. "primaryKey": false,
  1026. "notNull": false
  1027. },
  1028. "favicon_url": {
  1029. "name": "favicon_url",
  1030. "type": "text",
  1031. "primaryKey": false,
  1032. "notNull": false
  1033. },
  1034. "tpm": {
  1035. "name": "tpm",
  1036. "type": "integer",
  1037. "primaryKey": false,
  1038. "notNull": false,
  1039. "default": 0
  1040. },
  1041. "rpm": {
  1042. "name": "rpm",
  1043. "type": "integer",
  1044. "primaryKey": false,
  1045. "notNull": false,
  1046. "default": 0
  1047. },
  1048. "rpd": {
  1049. "name": "rpd",
  1050. "type": "integer",
  1051. "primaryKey": false,
  1052. "notNull": false,
  1053. "default": 0
  1054. },
  1055. "cc": {
  1056. "name": "cc",
  1057. "type": "integer",
  1058. "primaryKey": false,
  1059. "notNull": false,
  1060. "default": 0
  1061. },
  1062. "created_at": {
  1063. "name": "created_at",
  1064. "type": "timestamp with time zone",
  1065. "primaryKey": false,
  1066. "notNull": false,
  1067. "default": "now()"
  1068. },
  1069. "updated_at": {
  1070. "name": "updated_at",
  1071. "type": "timestamp with time zone",
  1072. "primaryKey": false,
  1073. "notNull": false,
  1074. "default": "now()"
  1075. },
  1076. "deleted_at": {
  1077. "name": "deleted_at",
  1078. "type": "timestamp with time zone",
  1079. "primaryKey": false,
  1080. "notNull": false
  1081. }
  1082. },
  1083. "indexes": {
  1084. "idx_providers_enabled_priority": {
  1085. "name": "idx_providers_enabled_priority",
  1086. "columns": [
  1087. {
  1088. "expression": "is_enabled",
  1089. "isExpression": false,
  1090. "asc": true,
  1091. "nulls": "last"
  1092. },
  1093. {
  1094. "expression": "priority",
  1095. "isExpression": false,
  1096. "asc": true,
  1097. "nulls": "last"
  1098. },
  1099. {
  1100. "expression": "weight",
  1101. "isExpression": false,
  1102. "asc": true,
  1103. "nulls": "last"
  1104. }
  1105. ],
  1106. "isUnique": false,
  1107. "where": "\"providers\".\"deleted_at\" IS NULL",
  1108. "concurrently": false,
  1109. "method": "btree",
  1110. "with": {}
  1111. },
  1112. "idx_providers_group": {
  1113. "name": "idx_providers_group",
  1114. "columns": [
  1115. {
  1116. "expression": "group_tag",
  1117. "isExpression": false,
  1118. "asc": true,
  1119. "nulls": "last"
  1120. }
  1121. ],
  1122. "isUnique": false,
  1123. "where": "\"providers\".\"deleted_at\" IS NULL",
  1124. "concurrently": false,
  1125. "method": "btree",
  1126. "with": {}
  1127. },
  1128. "idx_providers_created_at": {
  1129. "name": "idx_providers_created_at",
  1130. "columns": [
  1131. {
  1132. "expression": "created_at",
  1133. "isExpression": false,
  1134. "asc": true,
  1135. "nulls": "last"
  1136. }
  1137. ],
  1138. "isUnique": false,
  1139. "concurrently": false,
  1140. "method": "btree",
  1141. "with": {}
  1142. },
  1143. "idx_providers_deleted_at": {
  1144. "name": "idx_providers_deleted_at",
  1145. "columns": [
  1146. {
  1147. "expression": "deleted_at",
  1148. "isExpression": false,
  1149. "asc": true,
  1150. "nulls": "last"
  1151. }
  1152. ],
  1153. "isUnique": false,
  1154. "concurrently": false,
  1155. "method": "btree",
  1156. "with": {}
  1157. }
  1158. },
  1159. "foreignKeys": {},
  1160. "compositePrimaryKeys": {},
  1161. "uniqueConstraints": {},
  1162. "policies": {},
  1163. "checkConstraints": {},
  1164. "isRLSEnabled": false
  1165. },
  1166. "public.sensitive_words": {
  1167. "name": "sensitive_words",
  1168. "schema": "",
  1169. "columns": {
  1170. "id": {
  1171. "name": "id",
  1172. "type": "serial",
  1173. "primaryKey": true,
  1174. "notNull": true
  1175. },
  1176. "word": {
  1177. "name": "word",
  1178. "type": "varchar(255)",
  1179. "primaryKey": false,
  1180. "notNull": true
  1181. },
  1182. "match_type": {
  1183. "name": "match_type",
  1184. "type": "varchar(20)",
  1185. "primaryKey": false,
  1186. "notNull": true,
  1187. "default": "'contains'"
  1188. },
  1189. "description": {
  1190. "name": "description",
  1191. "type": "text",
  1192. "primaryKey": false,
  1193. "notNull": false
  1194. },
  1195. "is_enabled": {
  1196. "name": "is_enabled",
  1197. "type": "boolean",
  1198. "primaryKey": false,
  1199. "notNull": true,
  1200. "default": true
  1201. },
  1202. "created_at": {
  1203. "name": "created_at",
  1204. "type": "timestamp with time zone",
  1205. "primaryKey": false,
  1206. "notNull": false,
  1207. "default": "now()"
  1208. },
  1209. "updated_at": {
  1210. "name": "updated_at",
  1211. "type": "timestamp with time zone",
  1212. "primaryKey": false,
  1213. "notNull": false,
  1214. "default": "now()"
  1215. }
  1216. },
  1217. "indexes": {
  1218. "idx_sensitive_words_enabled": {
  1219. "name": "idx_sensitive_words_enabled",
  1220. "columns": [
  1221. {
  1222. "expression": "is_enabled",
  1223. "isExpression": false,
  1224. "asc": true,
  1225. "nulls": "last"
  1226. },
  1227. {
  1228. "expression": "match_type",
  1229. "isExpression": false,
  1230. "asc": true,
  1231. "nulls": "last"
  1232. }
  1233. ],
  1234. "isUnique": false,
  1235. "concurrently": false,
  1236. "method": "btree",
  1237. "with": {}
  1238. },
  1239. "idx_sensitive_words_created_at": {
  1240. "name": "idx_sensitive_words_created_at",
  1241. "columns": [
  1242. {
  1243. "expression": "created_at",
  1244. "isExpression": false,
  1245. "asc": true,
  1246. "nulls": "last"
  1247. }
  1248. ],
  1249. "isUnique": false,
  1250. "concurrently": false,
  1251. "method": "btree",
  1252. "with": {}
  1253. }
  1254. },
  1255. "foreignKeys": {},
  1256. "compositePrimaryKeys": {},
  1257. "uniqueConstraints": {},
  1258. "policies": {},
  1259. "checkConstraints": {},
  1260. "isRLSEnabled": false
  1261. },
  1262. "public.system_settings": {
  1263. "name": "system_settings",
  1264. "schema": "",
  1265. "columns": {
  1266. "id": {
  1267. "name": "id",
  1268. "type": "serial",
  1269. "primaryKey": true,
  1270. "notNull": true
  1271. },
  1272. "site_title": {
  1273. "name": "site_title",
  1274. "type": "varchar(128)",
  1275. "primaryKey": false,
  1276. "notNull": true,
  1277. "default": "'Claude Code Hub'"
  1278. },
  1279. "allow_global_usage_view": {
  1280. "name": "allow_global_usage_view",
  1281. "type": "boolean",
  1282. "primaryKey": false,
  1283. "notNull": true,
  1284. "default": false
  1285. },
  1286. "currency_display": {
  1287. "name": "currency_display",
  1288. "type": "varchar(10)",
  1289. "primaryKey": false,
  1290. "notNull": true,
  1291. "default": "'USD'"
  1292. },
  1293. "enable_auto_cleanup": {
  1294. "name": "enable_auto_cleanup",
  1295. "type": "boolean",
  1296. "primaryKey": false,
  1297. "notNull": false,
  1298. "default": false
  1299. },
  1300. "cleanup_retention_days": {
  1301. "name": "cleanup_retention_days",
  1302. "type": "integer",
  1303. "primaryKey": false,
  1304. "notNull": false,
  1305. "default": 30
  1306. },
  1307. "cleanup_schedule": {
  1308. "name": "cleanup_schedule",
  1309. "type": "varchar(50)",
  1310. "primaryKey": false,
  1311. "notNull": false,
  1312. "default": "'0 2 * * *'"
  1313. },
  1314. "cleanup_batch_size": {
  1315. "name": "cleanup_batch_size",
  1316. "type": "integer",
  1317. "primaryKey": false,
  1318. "notNull": false,
  1319. "default": 10000
  1320. },
  1321. "enable_client_version_check": {
  1322. "name": "enable_client_version_check",
  1323. "type": "boolean",
  1324. "primaryKey": false,
  1325. "notNull": true,
  1326. "default": false
  1327. },
  1328. "created_at": {
  1329. "name": "created_at",
  1330. "type": "timestamp with time zone",
  1331. "primaryKey": false,
  1332. "notNull": false,
  1333. "default": "now()"
  1334. },
  1335. "updated_at": {
  1336. "name": "updated_at",
  1337. "type": "timestamp with time zone",
  1338. "primaryKey": false,
  1339. "notNull": false,
  1340. "default": "now()"
  1341. }
  1342. },
  1343. "indexes": {},
  1344. "foreignKeys": {},
  1345. "compositePrimaryKeys": {},
  1346. "uniqueConstraints": {},
  1347. "policies": {},
  1348. "checkConstraints": {},
  1349. "isRLSEnabled": false
  1350. },
  1351. "public.users": {
  1352. "name": "users",
  1353. "schema": "",
  1354. "columns": {
  1355. "id": {
  1356. "name": "id",
  1357. "type": "serial",
  1358. "primaryKey": true,
  1359. "notNull": true
  1360. },
  1361. "name": {
  1362. "name": "name",
  1363. "type": "varchar",
  1364. "primaryKey": false,
  1365. "notNull": true
  1366. },
  1367. "description": {
  1368. "name": "description",
  1369. "type": "text",
  1370. "primaryKey": false,
  1371. "notNull": false
  1372. },
  1373. "role": {
  1374. "name": "role",
  1375. "type": "varchar",
  1376. "primaryKey": false,
  1377. "notNull": false,
  1378. "default": "'user'"
  1379. },
  1380. "rpm_limit": {
  1381. "name": "rpm_limit",
  1382. "type": "integer",
  1383. "primaryKey": false,
  1384. "notNull": false,
  1385. "default": 60
  1386. },
  1387. "daily_limit_usd": {
  1388. "name": "daily_limit_usd",
  1389. "type": "numeric(10, 2)",
  1390. "primaryKey": false,
  1391. "notNull": false,
  1392. "default": "'100.00'"
  1393. },
  1394. "provider_group": {
  1395. "name": "provider_group",
  1396. "type": "varchar(50)",
  1397. "primaryKey": false,
  1398. "notNull": false
  1399. },
  1400. "created_at": {
  1401. "name": "created_at",
  1402. "type": "timestamp with time zone",
  1403. "primaryKey": false,
  1404. "notNull": false,
  1405. "default": "now()"
  1406. },
  1407. "updated_at": {
  1408. "name": "updated_at",
  1409. "type": "timestamp with time zone",
  1410. "primaryKey": false,
  1411. "notNull": false,
  1412. "default": "now()"
  1413. },
  1414. "deleted_at": {
  1415. "name": "deleted_at",
  1416. "type": "timestamp with time zone",
  1417. "primaryKey": false,
  1418. "notNull": false
  1419. }
  1420. },
  1421. "indexes": {
  1422. "idx_users_active_role_sort": {
  1423. "name": "idx_users_active_role_sort",
  1424. "columns": [
  1425. {
  1426. "expression": "deleted_at",
  1427. "isExpression": false,
  1428. "asc": true,
  1429. "nulls": "last"
  1430. },
  1431. {
  1432. "expression": "role",
  1433. "isExpression": false,
  1434. "asc": true,
  1435. "nulls": "last"
  1436. },
  1437. {
  1438. "expression": "id",
  1439. "isExpression": false,
  1440. "asc": true,
  1441. "nulls": "last"
  1442. }
  1443. ],
  1444. "isUnique": false,
  1445. "where": "\"users\".\"deleted_at\" IS NULL",
  1446. "concurrently": false,
  1447. "method": "btree",
  1448. "with": {}
  1449. },
  1450. "idx_users_created_at": {
  1451. "name": "idx_users_created_at",
  1452. "columns": [
  1453. {
  1454. "expression": "created_at",
  1455. "isExpression": false,
  1456. "asc": true,
  1457. "nulls": "last"
  1458. }
  1459. ],
  1460. "isUnique": false,
  1461. "concurrently": false,
  1462. "method": "btree",
  1463. "with": {}
  1464. },
  1465. "idx_users_deleted_at": {
  1466. "name": "idx_users_deleted_at",
  1467. "columns": [
  1468. {
  1469. "expression": "deleted_at",
  1470. "isExpression": false,
  1471. "asc": true,
  1472. "nulls": "last"
  1473. }
  1474. ],
  1475. "isUnique": false,
  1476. "concurrently": false,
  1477. "method": "btree",
  1478. "with": {}
  1479. }
  1480. },
  1481. "foreignKeys": {},
  1482. "compositePrimaryKeys": {},
  1483. "uniqueConstraints": {},
  1484. "policies": {},
  1485. "checkConstraints": {},
  1486. "isRLSEnabled": false
  1487. }
  1488. },
  1489. "enums": {},
  1490. "schemas": {},
  1491. "sequences": {},
  1492. "roles": {},
  1493. "policies": {},
  1494. "views": {},
  1495. "_meta": {
  1496. "columns": {},
  1497. "schemas": {},
  1498. "tables": {}
  1499. }
  1500. }