SPB Git

spb/rareindex

Public

Auction fees foundation: buyer-premium schedules (data/fees/auction-houses.json), fees.ts (marginal tiers, min/max/fixed, all-in price with basis), sales.all_in_usd/fee_basis, auction_lots USD + assessment columns; migration 0007

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Simon-Pierre Boucher committed (Sep 11, 2026) parent a1e47ef Browse files

8 changed files +9,523 −1

added data/fees/auction-houses.json +66 −0
@@ -0,0 +1,66 @@
1+{
2+ "$comment": "Buyer's premium schedules (§35). Marginal tiers on the hammer price, in the house's billing currency (tiers are approximated in other currencies at the current FX rate). confidence: 'published' = taken from the house's terms at as_of; 'approximate' = widely reported but not re-verified against the current terms — shown as ≈ and labelled 'estimated' everywhere; 'none' = no buyer premium by design. Anything not listed falls back to `default` (auction_house 22 %, labelled 'default'). VAT/sales tax on the premium, import duties and shipping are NOT included and are stated as such in the UI. Never present these numbers as the exact invoice a buyer will receive.",
3+ "version": 1,
4+ "as_of": "2026-09-11",
5+ "default": { "auction_house": { "rate": 0.22, "confidence": "default", "note": "Typical contemporary buyer's premium for a regional auction house; used only when the house is unknown." }, "marketplace": { "rate": 0, "confidence": "none", "note": "Fixed-price marketplaces bill the asking price; fees are the seller's." } },
6+ "houses": [
7+ { "id": "sothebys", "name": "Sotheby's", "aliases": ["Sotheby's", "Sothebys", "sothebys", "RM Sotheby's Online"], "currency": "USD", "tiers": [{ "upTo": 1000000, "rate": 0.27 }, { "upTo": 8000000, "rate": 0.22 }, { "upTo": null, "rate": 0.15 }], "confidence": "published", "source": "https://www.sothebys.com/en/buy-sell/buying/buyers-premium", "note": "Standard schedule reinstated Feb 2025; wine, cars and some online sales use different rates." },
8+ { "id": "christies", "name": "Christie's", "aliases": ["Christie's", "Christies", "christies"], "currency": "USD", "tiers": [{ "upTo": 1000000, "rate": 0.26 }, { "upTo": 6000000, "rate": 0.21 }, { "upTo": null, "rate": 0.15 }], "confidence": "published", "source": "https://www.christies.com/en/help/buying-guide/financial-information" },
9+ { "id": "phillips", "name": "Phillips", "aliases": ["Phillips", "phillips-watches", "phillips-art"], "currency": "USD", "tiers": [{ "upTo": 1000000, "rate": 0.27 }, { "upTo": 6000000, "rate": 0.21 }, { "upTo": null, "rate": 0.145 }], "confidence": "approximate", "source": "https://www.phillips.com/buysell/buy" },
10+ { "id": "bonhams", "name": "Bonhams", "aliases": ["Bonhams", "the-market-bonhams", "Bonhams Skinner", "Bonhams Cornette de Saint Cyr"], "currency": "USD", "tiers": [{ "upTo": 50000, "rate": 0.28 }, { "upTo": 1000000, "rate": 0.27 }, { "upTo": 6000000, "rate": 0.21 }, { "upTo": null, "rate": 0.145 }], "confidence": "approximate", "source": "https://www.bonhams.com/buyers_guide/" },
11+ { "id": "heritage", "name": "Heritage Auctions", "aliases": ["Heritage Auctions", "Heritage", "HA.com"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.2 }], "minimum": 19, "confidence": "approximate", "source": "https://www.ha.com/c/ref/terms-and-conditions.zx", "note": "20 % (min $19) for most categories; some comics/art sessions differ." },
12+ { "id": "goldin", "name": "Goldin", "aliases": ["Goldin", "Goldin Auctions"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.2 }], "confidence": "published", "source": "https://goldin.co/terms" },
13+ { "id": "catawiki", "name": "Catawiki", "aliases": ["Catawiki"], "currency": "EUR", "tiers": [{ "upTo": null, "rate": 0.09 }], "fixedFee": 1, "confidence": "approximate", "source": "https://www.catawiki.com/en/help_center", "note": "Buyer protection fee ≈ 9 % + €1 per lot." },
14+ { "id": "bring-a-trailer", "name": "Bring a Trailer", "aliases": ["Bring a Trailer", "bring-a-trailer", "BaT"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.05 }], "minimum": 250, "maximum": 7500, "confidence": "published", "source": "https://bringatrailer.com/faq/" },
15+ { "id": "cars-and-bids", "name": "Cars & Bids", "aliases": ["Cars & Bids", "cars-and-bids"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.05 }], "minimum": 225, "maximum": 7500, "confidence": "approximate", "source": "https://carsandbids.com/faq" },
16+ { "id": "collecting-cars", "name": "Collecting Cars", "aliases": ["Collecting Cars", "collecting-cars"], "currency": "GBP", "tiers": [{ "upTo": null, "rate": 0.072 }], "maximum": 6000, "confidence": "approximate", "note": "6 % + VAT on the fee, capped." },
17+ { "id": "mecum", "name": "Mecum Auctions", "aliases": ["Mecum Auctions", "Mecum", "mecum"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.1 }], "confidence": "approximate", "note": "10 % on-site; internet/phone bidders pay more." },
18+ { "id": "rm-sothebys", "name": "RM Sotheby's", "aliases": ["RM Sotheby's", "rm-sothebys", "RM Auctions"], "currency": "USD", "tiers": [{ "upTo": 250000, "rate": 0.12 }, { "upTo": null, "rate": 0.1 }], "confidence": "approximate" },
19+ { "id": "gooding", "name": "Gooding & Company", "aliases": ["Gooding & Company", "Gooding", "gooding"], "currency": "USD", "tiers": [{ "upTo": 250000, "rate": 0.12 }, { "upTo": null, "rate": 0.1 }], "confidence": "approximate" },
20+ { "id": "hakes", "name": "Hake's Auctions", "aliases": ["Hake's Auctions", "Hake's", "hakes"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.2 }], "confidence": "approximate" },
21+ { "id": "scp", "name": "SCP Auctions", "aliases": ["SCP Auctions", "scp-auctions"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.2 }], "confidence": "approximate" },
22+ { "id": "lelands", "name": "Lelands", "aliases": ["Lelands", "lelands"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.2 }], "confidence": "approximate" },
23+ { "id": "comiclink", "name": "ComicLink", "aliases": ["ComicLink", "comiclink"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0 }], "confidence": "none", "note": "No buyer's premium; the seller pays the commission." },
24+ { "id": "comicconnect", "name": "ComicConnect", "aliases": ["ComicConnect", "comicconnect"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0 }], "confidence": "approximate", "note": "No buyer's premium on most sales." },
25+ { "id": "yahoo-auctions-jp", "name": "Yahoo! Auctions Japan", "aliases": ["Yahoo! Auctions Japan", "Yahoo! Auctions Japan (ヤフオク!)", "yahoo-auctions-jp", "ヤフオク!"], "currency": "JPY", "tiers": [{ "upTo": null, "rate": 0 }], "confidence": "none", "note": "No buyer's fee; the seller pays the system fee. Proxy/forwarding fees for overseas buyers are not modelled." },
26+ { "id": "noonans", "name": "Noonans Mayfair", "aliases": ["Noonans Mayfair", "Noonans", "noonans", "DNW"], "currency": "GBP", "tiers": [{ "upTo": null, "rate": 0.24 }], "confidence": "approximate", "note": "VAT on the premium not included." },
27+ { "id": "potter", "name": "Potter & Potter Auctions", "aliases": ["Potter & Potter Auctions", "Potter & Potter", "potter-auctions"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.2 }], "confidence": "approximate", "note": "Online bidding platforms add their own surcharge." },
28+ { "id": "swann", "name": "Swann Auction Galleries", "aliases": ["Swann Auction Galleries", "Swann", "swann"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.25 }], "confidence": "approximate" },
29+ { "id": "pba", "name": "PBA Galleries", "aliases": ["PBA Galleries", "pba-galleries"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.25 }], "confidence": "approximate" },
30+ { "id": "doyle", "name": "Doyle", "aliases": ["Doyle", "doyle", "Doyle New York"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.27 }], "confidence": "approximate" },
31+ { "id": "wright", "name": "Wright", "aliases": ["Wright", "wright", "Rago/Wright", "Rago"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.25 }], "confidence": "approximate" },
32+ { "id": "lama", "name": "Los Angeles Modern Auctions", "aliases": ["Los Angeles Modern Auctions", "LAMA", "lama"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.25 }], "confidence": "approximate" },
33+ { "id": "whisky-auction", "name": "Whisky.Auction", "aliases": ["Whisky.Auction", "whisky-auction"], "currency": "GBP", "tiers": [{ "upTo": null, "rate": 0.12 }], "confidence": "approximate", "note": "≈ 10 % buyer fee + VAT on the fee." },
34+ { "id": "just-whisky", "name": "Just Whisky", "aliases": ["Just Whisky", "just-whisky"], "currency": "GBP", "tiers": [{ "upTo": null, "rate": 0.12 }], "confidence": "approximate" },
35+ { "id": "whisky-hammer", "name": "Whisky Hammer", "aliases": ["Whisky Hammer", "whisky-hammer"], "currency": "GBP", "tiers": [{ "upTo": null, "rate": 0.12 }], "confidence": "approximate" },
36+ { "id": "scotch-whisky-auctions", "name": "Scotch Whisky Auctions", "aliases": ["Scotch Whisky Auctions", "scotch-whisky-auctions"], "currency": "GBP", "tiers": [{ "upTo": null, "rate": 0.12 }], "confidence": "approximate" },
37+ { "id": "hdh", "name": "Hart Davis Hart Wine Co.", "aliases": ["Hart Davis Hart Wine Co.", "HDH", "hdh-wine"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.24 }], "confidence": "approximate" },
38+ { "id": "winebid", "name": "WineBid", "aliases": ["WineBid", "winebid"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.17 }], "confidence": "approximate" },
39+ { "id": "tokyo-chuo", "name": "Tokyo Chuo Auction", "aliases": ["Tokyo Chuo Auction", "tokyo-chuo"], "currency": "JPY", "tiers": [{ "upTo": null, "rate": 0.15 }], "confidence": "approximate" },
40+ { "id": "sgbaldwins", "name": "Stanley Gibbons Baldwin's", "aliases": ["Stanley Gibbons Baldwin's", "Baldwin's", "sgbaldwins"], "currency": "GBP", "tiers": [{ "upTo": null, "rate": 0.2 }], "confidence": "approximate", "note": "VAT on the premium not included." },
41+ { "id": "corinphila", "name": "Corinphila Auctions", "aliases": ["Corinphila Auctions", "Corinphila", "corinphila"], "currency": "CHF", "tiers": [{ "upTo": null, "rate": 0.22 }], "confidence": "approximate" },
42+ { "id": "kuenker", "name": "Künker", "aliases": ["Künker", "Kuenker", "kuenker", "Fritz Rudolf Künker"], "currency": "EUR", "tiers": [{ "upTo": null, "rate": 0.25 }], "confidence": "approximate" },
43+ { "id": "noble", "name": "Noble Numismatics", "aliases": ["Noble Numismatics", "noble"], "currency": "AUD", "tiers": [{ "upTo": null, "rate": 0.1925 }], "confidence": "approximate", "note": "17.5 % + GST." },
44+ { "id": "dunbar-sloane", "name": "Dunbar Sloane", "aliases": ["Dunbar Sloane", "dunbar-sloane"], "currency": "NZD", "tiers": [{ "upTo": null, "rate": 0.175 }], "confidence": "approximate" },
45+ { "id": "miller-miller", "name": "Miller & Miller Auctions", "aliases": ["Miller & Miller Auctions", "Miller & Miller", "miller-miller"], "currency": "CAD", "tiers": [{ "upTo": null, "rate": 0.18 }], "confidence": "approximate" },
46+ { "id": "aguttes", "name": "Aguttes", "aliases": ["Aguttes", "aguttes"], "currency": "EUR", "tiers": [{ "upTo": null, "rate": 0.3 }], "confidence": "approximate", "note": "≈ 25 % HT + TVA." },
47+ { "id": "artcurial", "name": "Artcurial", "aliases": ["Artcurial", "artcurial"], "currency": "EUR", "tiers": [{ "upTo": 700000, "rate": 0.3 }, { "upTo": null, "rate": 0.24 }], "confidence": "approximate", "note": "TTC; motorcars use a different schedule." },
48+ { "id": "millon", "name": "Millon", "aliases": ["Millon", "millon"], "currency": "EUR", "tiers": [{ "upTo": null, "rate": 0.3 }], "confidence": "approximate" },
49+ { "id": "piasa", "name": "PIASA", "aliases": ["PIASA", "piasa"], "currency": "EUR", "tiers": [{ "upTo": null, "rate": 0.3 }], "confidence": "approximate" },
50+ { "id": "ader", "name": "Ader", "aliases": ["Ader", "ader"], "currency": "EUR", "tiers": [{ "upTo": null, "rate": 0.28 }], "confidence": "approximate" },
51+ { "id": "osenat", "name": "Osenat", "aliases": ["Osenat", "osenat"], "currency": "EUR", "tiers": [{ "upTo": null, "rate": 0.3 }], "confidence": "approximate" },
52+ { "id": "chiswick", "name": "Chiswick Auctions", "aliases": ["Chiswick Auctions", "Chiswick", "chiswick"], "currency": "GBP", "tiers": [{ "upTo": null, "rate": 0.3 }], "confidence": "approximate", "note": "25 % + VAT." },
53+ { "id": "dominic-winter", "name": "Dominic Winter Auctioneers", "aliases": ["Dominic Winter Auctioneers", "Dominic Winter", "dominic-winter"], "currency": "GBP", "tiers": [{ "upTo": null, "rate": 0.288 }], "confidence": "approximate", "note": "24 % + VAT." },
54+ { "id": "sworders", "name": "Sworders", "aliases": ["Sworders", "sworders"], "currency": "GBP", "tiers": [{ "upTo": null, "rate": 0.3 }], "confidence": "approximate", "note": "25 % + VAT." },
55+ { "id": "woolley-wallis", "name": "Woolley & Wallis", "aliases": ["Woolley & Wallis", "woolley-wallis"], "currency": "GBP", "tiers": [{ "upTo": null, "rate": 0.312 }], "confidence": "approximate", "note": "26 % + VAT." },
56+ { "id": "lyon-turnbull", "name": "Lyon & Turnbull", "aliases": ["Lyon & Turnbull", "lyon-turnbull"], "currency": "GBP", "tiers": [{ "upTo": null, "rate": 0.312 }], "confidence": "approximate", "note": "26 % + VAT." },
57+ { "id": "auctionet", "name": "Auctionet", "aliases": ["Auctionet", "auctionet"], "currency": "EUR", "tiers": [{ "upTo": null, "rate": 0.225 }], "confidence": "approximate", "note": "Varies by partner house." },
58+ { "id": "aste-bolaffi", "name": "Aste Bolaffi", "aliases": ["Aste Bolaffi", "Bolaffi", "aste-bolaffi"], "currency": "EUR", "tiers": [{ "upTo": null, "rate": 0.24 }], "confidence": "approximate" },
59+ { "id": "antiquorum", "name": "Antiquorum", "aliases": ["Antiquorum", "antiquorum"], "currency": "CHF", "tiers": [{ "upTo": null, "rate": 0.25 }], "confidence": "approximate" },
60+ { "id": "dlrc", "name": "David Lawrence Rare Coins", "aliases": ["David Lawrence Rare Coins", "DLRC", "dlrc"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.1 }], "confidence": "approximate" },
61+ { "id": "kelleher", "name": "Kelleher Auctions", "aliases": ["Kelleher Auctions", "Kelleher", "kelleher"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.2 }], "confidence": "approximate" },
62+ { "id": "clean-sweep", "name": "Clean Sweep Auctions", "aliases": ["Clean Sweep Auctions", "clean-sweep"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0.2 }], "confidence": "approximate" },
63+ { "id": "mycomicshop", "name": "MyComicShop", "aliases": ["MyComicShop", "mycomicshop"], "currency": "USD", "tiers": [{ "upTo": null, "rate": 0 }], "confidence": "approximate", "note": "No buyer's premium on MyComicShop auctions." },
64+ { "id": "e-rocks", "name": "e-Rocks", "aliases": ["e-Rocks", "e-rocks"], "currency": "EUR", "tiers": [{ "upTo": null, "rate": 0 }], "confidence": "approximate", "note": "Marketplace auctions billed at the hammer price." }
65+ ]
66+}
added packages/database/migrations/0007_organic_colonel_america.sql +21 −0
@@ -0,0 +1,21 @@
1+ALTER TABLE "auction_lots" ADD COLUMN "estimate_low_usd" numeric(18, 4);--> statement-breakpoint
2+ALTER TABLE "auction_lots" ADD COLUMN "estimate_high_usd" numeric(18, 4);--> statement-breakpoint
3+ALTER TABLE "auction_lots" ADD COLUMN "current_bid_usd" numeric(18, 4);--> statement-breakpoint
4+ALTER TABLE "auction_lots" ADD COLUMN "hammer_price_usd" numeric(18, 4);--> statement-breakpoint
5+ALTER TABLE "auction_lots" ADD COLUMN "fx_rate" real;--> statement-breakpoint
6+ALTER TABLE "auction_lots" ADD COLUMN "fx_date" date;--> statement-breakpoint
7+ALTER TABLE "auction_lots" ADD COLUMN "buyer_premium_rate" real;--> statement-breakpoint
8+ALTER TABLE "auction_lots" ADD COLUMN "fee_basis" text;--> statement-breakpoint
9+ALTER TABLE "auction_lots" ADD COLUMN "all_in_bid_usd" numeric(18, 4);--> statement-breakpoint
10+ALTER TABLE "auction_lots" ADD COLUMN "all_in_estimate_low_usd" numeric(18, 4);--> statement-breakpoint
11+ALTER TABLE "auction_lots" ADD COLUMN "all_in_estimate_high_usd" numeric(18, 4);--> statement-breakpoint
12+ALTER TABLE "auction_lots" ADD COLUMN "riv_usd_at_assessment" numeric(18, 4);--> statement-breakpoint
13+ALTER TABLE "auction_lots" ADD COLUMN "bid_vs_riv" real;--> statement-breakpoint
14+ALTER TABLE "auction_lots" ADD COLUMN "estimate_vs_riv" real;--> statement-breakpoint
15+ALTER TABLE "auction_lots" ADD COLUMN "assessment_verdict" text;--> statement-breakpoint
16+ALTER TABLE "auction_lots" ADD COLUMN "assessed_at" timestamp with time zone;--> statement-breakpoint
17+ALTER TABLE "sales" ADD COLUMN "all_in_usd" numeric(18, 4);--> statement-breakpoint
18+ALTER TABLE "sales" ADD COLUMN "fee_basis" text;--> statement-breakpoint
19+ALTER TABLE "sales" ADD COLUMN "buyer_premium_rate" real;--> statement-breakpoint
20+CREATE INDEX "auction_lots_status_ends_idx" ON "auction_lots" USING btree ("status","ends_at");--> statement-breakpoint
21+CREATE INDEX "auction_lots_bid_vs_riv_idx" ON "auction_lots" USING btree ("bid_vs_riv") WHERE bid_vs_riv is not null and status in ('live','upcoming');
\ No newline at end of file
added packages/database/migrations/meta/0007_snapshot.json +9186 −0
@@ -0,0 +1,9186 @@
1+{
2+ "id": "7488f9e3-1468-4580-8cc6-f3ddf8be67f2",
3+ "prevId": "179d4792-c6f0-4fb6-b655-fb8cf497ddda",
4+ "version": "7",
5+ "dialect": "postgresql",
6+ "tables": {
7+ "public.brands": {
8+ "name": "brands",
9+ "schema": "",
10+ "columns": {
11+ "slug": {
12+ "name": "slug",
13+ "type": "text",
14+ "primaryKey": true,
15+ "notNull": true
16+ },
17+ "name": {
18+ "name": "name",
19+ "type": "text",
20+ "primaryKey": false,
21+ "notNull": true
22+ },
23+ "category_slugs": {
24+ "name": "category_slugs",
25+ "type": "text[]",
26+ "primaryKey": false,
27+ "notNull": true,
28+ "default": "'{}'::text[]"
29+ },
30+ "country": {
31+ "name": "country",
32+ "type": "text",
33+ "primaryKey": false,
34+ "notNull": false
35+ },
36+ "founded_year": {
37+ "name": "founded_year",
38+ "type": "integer",
39+ "primaryKey": false,
40+ "notNull": false
41+ },
42+ "metadata": {
43+ "name": "metadata",
44+ "type": "jsonb",
45+ "primaryKey": false,
46+ "notNull": true,
47+ "default": "'{}'::jsonb"
48+ },
49+ "created_at": {
50+ "name": "created_at",
51+ "type": "timestamp with time zone",
52+ "primaryKey": false,
53+ "notNull": true,
54+ "default": "now()"
55+ }
56+ },
57+ "indexes": {
58+ "brands_name_idx": {
59+ "name": "brands_name_idx",
60+ "columns": [
61+ {
62+ "expression": "name",
63+ "isExpression": false,
64+ "asc": true,
65+ "nulls": "last"
66+ }
67+ ],
68+ "isUnique": false,
69+ "concurrently": false,
70+ "method": "btree",
71+ "with": {}
72+ }
73+ },
74+ "foreignKeys": {},
75+ "compositePrimaryKeys": {},
76+ "uniqueConstraints": {},
77+ "policies": {},
78+ "checkConstraints": {},
79+ "isRLSEnabled": false
80+ },
81+ "public.categories": {
82+ "name": "categories",
83+ "schema": "",
84+ "columns": {
85+ "slug": {
86+ "name": "slug",
87+ "type": "text",
88+ "primaryKey": true,
89+ "notNull": true
90+ },
91+ "parent_slug": {
92+ "name": "parent_slug",
93+ "type": "text",
94+ "primaryKey": false,
95+ "notNull": false
96+ },
97+ "family_slug": {
98+ "name": "family_slug",
99+ "type": "text",
100+ "primaryKey": false,
101+ "notNull": true
102+ },
103+ "name": {
104+ "name": "name",
105+ "type": "text",
106+ "primaryKey": false,
107+ "notNull": true
108+ },
109+ "short_name": {
110+ "name": "short_name",
111+ "type": "text",
112+ "primaryKey": false,
113+ "notNull": false
114+ },
115+ "description": {
116+ "name": "description",
117+ "type": "text",
118+ "primaryKey": false,
119+ "notNull": false
120+ },
121+ "level": {
122+ "name": "level",
123+ "type": "integer",
124+ "primaryKey": false,
125+ "notNull": true,
126+ "default": 0
127+ },
128+ "phase": {
129+ "name": "phase",
130+ "type": "integer",
131+ "primaryKey": false,
132+ "notNull": true,
133+ "default": 3
134+ },
135+ "active": {
136+ "name": "active",
137+ "type": "boolean",
138+ "primaryKey": false,
139+ "notNull": true,
140+ "default": true
141+ },
142+ "condition_scale": {
143+ "name": "condition_scale",
144+ "type": "text",
145+ "primaryKey": false,
146+ "notNull": false
147+ },
148+ "graders": {
149+ "name": "graders",
150+ "type": "text[]",
151+ "primaryKey": false,
152+ "notNull": true,
153+ "default": "'{}'::text[]"
154+ },
155+ "index_ticker": {
156+ "name": "index_ticker",
157+ "type": "text",
158+ "primaryKey": false,
159+ "notNull": false
160+ },
161+ "attribute_schema": {
162+ "name": "attribute_schema",
163+ "type": "jsonb",
164+ "primaryKey": false,
165+ "notNull": true,
166+ "default": "'{}'::jsonb"
167+ },
168+ "sort_order": {
169+ "name": "sort_order",
170+ "type": "integer",
171+ "primaryKey": false,
172+ "notNull": true,
173+ "default": 0
174+ },
175+ "compliance_flags": {
176+ "name": "compliance_flags",
177+ "type": "text[]",
178+ "primaryKey": false,
179+ "notNull": true,
180+ "default": "'{}'::text[]"
181+ },
182+ "icon": {
183+ "name": "icon",
184+ "type": "text",
185+ "primaryKey": false,
186+ "notNull": false
187+ },
188+ "created_at": {
189+ "name": "created_at",
190+ "type": "timestamp with time zone",
191+ "primaryKey": false,
192+ "notNull": true,
193+ "default": "now()"
194+ },
195+ "updated_at": {
196+ "name": "updated_at",
197+ "type": "timestamp with time zone",
198+ "primaryKey": false,
199+ "notNull": true,
200+ "default": "now()"
201+ }
202+ },
203+ "indexes": {
204+ "categories_parent_idx": {
205+ "name": "categories_parent_idx",
206+ "columns": [
207+ {
208+ "expression": "parent_slug",
209+ "isExpression": false,
210+ "asc": true,
211+ "nulls": "last"
212+ }
213+ ],
214+ "isUnique": false,
215+ "concurrently": false,
216+ "method": "btree",
217+ "with": {}
218+ },
219+ "categories_family_idx": {
220+ "name": "categories_family_idx",
221+ "columns": [
222+ {
223+ "expression": "family_slug",
224+ "isExpression": false,
225+ "asc": true,
226+ "nulls": "last"
227+ }
228+ ],
229+ "isUnique": false,
230+ "concurrently": false,
231+ "method": "btree",
232+ "with": {}
233+ }
234+ },
235+ "foreignKeys": {},
236+ "compositePrimaryKeys": {},
237+ "uniqueConstraints": {},
238+ "policies": {},
239+ "checkConstraints": {},
240+ "isRLSEnabled": false
241+ },
242+ "public.franchises": {
243+ "name": "franchises",
244+ "schema": "",
245+ "columns": {
246+ "slug": {
247+ "name": "slug",
248+ "type": "text",
249+ "primaryKey": true,
250+ "notNull": true
251+ },
252+ "name": {
253+ "name": "name",
254+ "type": "text",
255+ "primaryKey": false,
256+ "notNull": true
257+ },
258+ "owner": {
259+ "name": "owner",
260+ "type": "text",
261+ "primaryKey": false,
262+ "notNull": false
263+ },
264+ "category_slugs": {
265+ "name": "category_slugs",
266+ "type": "text[]",
267+ "primaryKey": false,
268+ "notNull": true,
269+ "default": "'{}'::text[]"
270+ },
271+ "metadata": {
272+ "name": "metadata",
273+ "type": "jsonb",
274+ "primaryKey": false,
275+ "notNull": true,
276+ "default": "'{}'::jsonb"
277+ },
278+ "created_at": {
279+ "name": "created_at",
280+ "type": "timestamp with time zone",
281+ "primaryKey": false,
282+ "notNull": true,
283+ "default": "now()"
284+ }
285+ },
286+ "indexes": {},
287+ "foreignKeys": {},
288+ "compositePrimaryKeys": {},
289+ "uniqueConstraints": {},
290+ "policies": {},
291+ "checkConstraints": {},
292+ "isRLSEnabled": false
293+ },
294+ "public.graders": {
295+ "name": "graders",
296+ "schema": "",
297+ "columns": {
298+ "slug": {
299+ "name": "slug",
300+ "type": "text",
301+ "primaryKey": true,
302+ "notNull": true
303+ },
304+ "name": {
305+ "name": "name",
306+ "type": "text",
307+ "primaryKey": false,
308+ "notNull": true
309+ },
310+ "category_slugs": {
311+ "name": "category_slugs",
312+ "type": "text[]",
313+ "primaryKey": false,
314+ "notNull": true,
315+ "default": "'{}'::text[]"
316+ },
317+ "scale": {
318+ "name": "scale",
319+ "type": "jsonb",
320+ "primaryKey": false,
321+ "notNull": true,
322+ "default": "'{}'::jsonb"
323+ },
324+ "population_url": {
325+ "name": "population_url",
326+ "type": "text",
327+ "primaryKey": false,
328+ "notNull": false
329+ },
330+ "verify_url": {
331+ "name": "verify_url",
332+ "type": "text",
333+ "primaryKey": false,
334+ "notNull": false
335+ },
336+ "active": {
337+ "name": "active",
338+ "type": "boolean",
339+ "primaryKey": false,
340+ "notNull": true,
341+ "default": true
342+ }
343+ },
344+ "indexes": {},
345+ "foreignKeys": {},
346+ "compositePrimaryKeys": {},
347+ "uniqueConstraints": {},
348+ "policies": {},
349+ "checkConstraints": {},
350+ "isRLSEnabled": false
351+ },
352+ "public.sets": {
353+ "name": "sets",
354+ "schema": "",
355+ "columns": {
356+ "slug": {
357+ "name": "slug",
358+ "type": "text",
359+ "primaryKey": true,
360+ "notNull": true
361+ },
362+ "name": {
363+ "name": "name",
364+ "type": "text",
365+ "primaryKey": false,
366+ "notNull": true
367+ },
368+ "code": {
369+ "name": "code",
370+ "type": "text",
371+ "primaryKey": false,
372+ "notNull": false
373+ },
374+ "category_slug": {
375+ "name": "category_slug",
376+ "type": "text",
377+ "primaryKey": false,
378+ "notNull": true
379+ },
380+ "franchise_slug": {
381+ "name": "franchise_slug",
382+ "type": "text",
383+ "primaryKey": false,
384+ "notNull": false
385+ },
386+ "brand_slug": {
387+ "name": "brand_slug",
388+ "type": "text",
389+ "primaryKey": false,
390+ "notNull": false
391+ },
392+ "release_year": {
393+ "name": "release_year",
394+ "type": "integer",
395+ "primaryKey": false,
396+ "notNull": false
397+ },
398+ "release_date": {
399+ "name": "release_date",
400+ "type": "text",
401+ "primaryKey": false,
402+ "notNull": false
403+ },
404+ "language": {
405+ "name": "language",
406+ "type": "text",
407+ "primaryKey": false,
408+ "notNull": false
409+ },
410+ "total_items": {
411+ "name": "total_items",
412+ "type": "integer",
413+ "primaryKey": false,
414+ "notNull": false
415+ },
416+ "identifiers": {
417+ "name": "identifiers",
418+ "type": "jsonb",
419+ "primaryKey": false,
420+ "notNull": true,
421+ "default": "'{}'::jsonb"
422+ },
423+ "metadata": {
424+ "name": "metadata",
425+ "type": "jsonb",
426+ "primaryKey": false,
427+ "notNull": true,
428+ "default": "'{}'::jsonb"
429+ },
430+ "created_at": {
431+ "name": "created_at",
432+ "type": "timestamp with time zone",
433+ "primaryKey": false,
434+ "notNull": true,
435+ "default": "now()"
436+ }
437+ },
438+ "indexes": {
439+ "sets_category_idx": {
440+ "name": "sets_category_idx",
441+ "columns": [
442+ {
443+ "expression": "category_slug",
444+ "isExpression": false,
445+ "asc": true,
446+ "nulls": "last"
447+ }
448+ ],
449+ "isUnique": false,
450+ "concurrently": false,
451+ "method": "btree",
452+ "with": {}
453+ },
454+ "sets_category_code_uq": {
455+ "name": "sets_category_code_uq",
456+ "columns": [
457+ {
458+ "expression": "category_slug",
459+ "isExpression": false,
460+ "asc": true,
461+ "nulls": "last"
462+ },
463+ {
464+ "expression": "code",
465+ "isExpression": false,
466+ "asc": true,
467+ "nulls": "last"
468+ }
469+ ],
470+ "isUnique": true,
471+ "concurrently": false,
472+ "method": "btree",
473+ "with": {}
474+ }
475+ },
476+ "foreignKeys": {},
477+ "compositePrimaryKeys": {},
478+ "uniqueConstraints": {},
479+ "policies": {},
480+ "checkConstraints": {},
481+ "isRLSEnabled": false
482+ },
483+ "public.taxonomy_proposals": {
484+ "name": "taxonomy_proposals",
485+ "schema": "",
486+ "columns": {
487+ "id": {
488+ "name": "id",
489+ "type": "text",
490+ "primaryKey": true,
491+ "notNull": true
492+ },
493+ "proposed_slug": {
494+ "name": "proposed_slug",
495+ "type": "text",
496+ "primaryKey": false,
497+ "notNull": true
498+ },
499+ "name": {
500+ "name": "name",
501+ "type": "text",
502+ "primaryKey": false,
503+ "notNull": true
504+ },
505+ "parent_slug": {
506+ "name": "parent_slug",
507+ "type": "text",
508+ "primaryKey": false,
509+ "notNull": false
510+ },
511+ "evidence": {
512+ "name": "evidence",
513+ "type": "jsonb",
514+ "primaryKey": false,
515+ "notNull": true,
516+ "default": "'{}'::jsonb"
517+ },
518+ "volume_estimate": {
519+ "name": "volume_estimate",
520+ "type": "integer",
521+ "primaryKey": false,
522+ "notNull": false
523+ },
524+ "status": {
525+ "name": "status",
526+ "type": "text",
527+ "primaryKey": false,
528+ "notNull": true,
529+ "default": "'pending'"
530+ },
531+ "decided_by": {
532+ "name": "decided_by",
533+ "type": "text",
534+ "primaryKey": false,
535+ "notNull": false
536+ },
537+ "decided_at": {
538+ "name": "decided_at",
539+ "type": "text",
540+ "primaryKey": false,
541+ "notNull": false
542+ },
543+ "created_at": {
544+ "name": "created_at",
545+ "type": "timestamp with time zone",
546+ "primaryKey": false,
547+ "notNull": true,
548+ "default": "now()"
549+ }
550+ },
551+ "indexes": {},
552+ "foreignKeys": {},
553+ "compositePrimaryKeys": {},
554+ "uniqueConstraints": {},
555+ "policies": {},
556+ "checkConstraints": {},
557+ "isRLSEnabled": false
558+ },
559+ "public.certificate_sightings": {
560+ "name": "certificate_sightings",
561+ "schema": "",
562+ "columns": {
563+ "id": {
564+ "name": "id",
565+ "type": "text",
566+ "primaryKey": true,
567+ "notNull": true
568+ },
569+ "certificate_id": {
570+ "name": "certificate_id",
571+ "type": "text",
572+ "primaryKey": false,
573+ "notNull": true
574+ },
575+ "kind": {
576+ "name": "kind",
577+ "type": "text",
578+ "primaryKey": false,
579+ "notNull": true
580+ },
581+ "target_id": {
582+ "name": "target_id",
583+ "type": "text",
584+ "primaryKey": false,
585+ "notNull": false
586+ },
587+ "source_id": {
588+ "name": "source_id",
589+ "type": "text",
590+ "primaryKey": false,
591+ "notNull": true
592+ },
593+ "connector_id": {
594+ "name": "connector_id",
595+ "type": "text",
596+ "primaryKey": false,
597+ "notNull": false
598+ },
599+ "source_url": {
600+ "name": "source_url",
601+ "type": "text",
602+ "primaryKey": false,
603+ "notNull": false
604+ },
605+ "price_usd": {
606+ "name": "price_usd",
607+ "type": "numeric(18, 4)",
608+ "primaryKey": false,
609+ "notNull": false
610+ },
611+ "currency": {
612+ "name": "currency",
613+ "type": "text",
614+ "primaryKey": false,
615+ "notNull": false
616+ },
617+ "price": {
618+ "name": "price",
619+ "type": "numeric(18, 4)",
620+ "primaryKey": false,
621+ "notNull": false
622+ },
623+ "observed_at": {
624+ "name": "observed_at",
625+ "type": "timestamp with time zone",
626+ "primaryKey": false,
627+ "notNull": true
628+ },
629+ "created_at": {
630+ "name": "created_at",
631+ "type": "timestamp with time zone",
632+ "primaryKey": false,
633+ "notNull": true,
634+ "default": "now()"
635+ }
636+ },
637+ "indexes": {
638+ "certificate_sightings_cert_idx": {
639+ "name": "certificate_sightings_cert_idx",
640+ "columns": [
641+ {
642+ "expression": "certificate_id",
643+ "isExpression": false,
644+ "asc": true,
645+ "nulls": "last"
646+ },
647+ {
648+ "expression": "observed_at",
649+ "isExpression": false,
650+ "asc": true,
651+ "nulls": "last"
652+ }
653+ ],
654+ "isUnique": false,
655+ "concurrently": false,
656+ "method": "btree",
657+ "with": {}
658+ },
659+ "certificate_sightings_uq": {
660+ "name": "certificate_sightings_uq",
661+ "columns": [
662+ {
663+ "expression": "certificate_id",
664+ "isExpression": false,
665+ "asc": true,
666+ "nulls": "last"
667+ },
668+ {
669+ "expression": "kind",
670+ "isExpression": false,
671+ "asc": true,
672+ "nulls": "last"
673+ },
674+ {
675+ "expression": "target_id",
676+ "isExpression": false,
677+ "asc": true,
678+ "nulls": "last"
679+ }
680+ ],
681+ "isUnique": true,
682+ "concurrently": false,
683+ "method": "btree",
684+ "with": {}
685+ }
686+ },
687+ "foreignKeys": {},
688+ "compositePrimaryKeys": {},
689+ "uniqueConstraints": {},
690+ "policies": {},
691+ "checkConstraints": {},
692+ "isRLSEnabled": false
693+ },
694+ "public.certificates": {
695+ "name": "certificates",
696+ "schema": "",
697+ "columns": {
698+ "id": {
699+ "name": "id",
700+ "type": "text",
701+ "primaryKey": true,
702+ "notNull": true
703+ },
704+ "grader": {
705+ "name": "grader",
706+ "type": "text",
707+ "primaryKey": false,
708+ "notNull": true
709+ },
710+ "cert_number": {
711+ "name": "cert_number",
712+ "type": "text",
713+ "primaryKey": false,
714+ "notNull": true
715+ },
716+ "asset_id": {
717+ "name": "asset_id",
718+ "type": "text",
719+ "primaryKey": false,
720+ "notNull": false
721+ },
722+ "variant_id": {
723+ "name": "variant_id",
724+ "type": "text",
725+ "primaryKey": false,
726+ "notNull": false
727+ },
728+ "grade": {
729+ "name": "grade",
730+ "type": "text",
731+ "primaryKey": false,
732+ "notNull": false
733+ },
734+ "qualifier": {
735+ "name": "qualifier",
736+ "type": "text",
737+ "primaryKey": false,
738+ "notNull": false
739+ },
740+ "verify_url": {
741+ "name": "verify_url",
742+ "type": "text",
743+ "primaryKey": false,
744+ "notNull": false
745+ },
746+ "first_seen_at": {
747+ "name": "first_seen_at",
748+ "type": "timestamp with time zone",
749+ "primaryKey": false,
750+ "notNull": true
751+ },
752+ "last_seen_at": {
753+ "name": "last_seen_at",
754+ "type": "timestamp with time zone",
755+ "primaryKey": false,
756+ "notNull": true
757+ },
758+ "sightings": {
759+ "name": "sightings",
760+ "type": "integer",
761+ "primaryKey": false,
762+ "notNull": true,
763+ "default": 0
764+ },
765+ "source_ids": {
766+ "name": "source_ids",
767+ "type": "text[]",
768+ "primaryKey": false,
769+ "notNull": true,
770+ "default": "'{}'::text[]"
771+ },
772+ "last_source_url": {
773+ "name": "last_source_url",
774+ "type": "text",
775+ "primaryKey": false,
776+ "notNull": false
777+ },
778+ "last_price_usd": {
779+ "name": "last_price_usd",
780+ "type": "numeric(18, 4)",
781+ "primaryKey": false,
782+ "notNull": false
783+ },
784+ "verified_at": {
785+ "name": "verified_at",
786+ "type": "timestamp with time zone",
787+ "primaryKey": false,
788+ "notNull": false
789+ },
790+ "verification": {
791+ "name": "verification",
792+ "type": "jsonb",
793+ "primaryKey": false,
794+ "notNull": true,
795+ "default": "'{}'::jsonb"
796+ },
797+ "created_at": {
798+ "name": "created_at",
799+ "type": "timestamp with time zone",
800+ "primaryKey": false,
801+ "notNull": true,
802+ "default": "now()"
803+ }
804+ },
805+ "indexes": {
806+ "certificates_grader_cert_uq": {
807+ "name": "certificates_grader_cert_uq",
808+ "columns": [
809+ {
810+ "expression": "grader",
811+ "isExpression": false,
812+ "asc": true,
813+ "nulls": "last"
814+ },
815+ {
816+ "expression": "cert_number",
817+ "isExpression": false,
818+ "asc": true,
819+ "nulls": "last"
820+ }
821+ ],
822+ "isUnique": true,
823+ "concurrently": false,
824+ "method": "btree",
825+ "with": {}
826+ },
827+ "certificates_asset_idx": {
828+ "name": "certificates_asset_idx",
829+ "columns": [
830+ {
831+ "expression": "asset_id",
832+ "isExpression": false,
833+ "asc": true,
834+ "nulls": "last"
835+ }
836+ ],
837+ "isUnique": false,
838+ "concurrently": false,
839+ "method": "btree",
840+ "with": {}
841+ },
842+ "certificates_last_seen_idx": {
843+ "name": "certificates_last_seen_idx",
844+ "columns": [
845+ {
846+ "expression": "last_seen_at",
847+ "isExpression": false,
848+ "asc": true,
849+ "nulls": "last"
850+ }
851+ ],
852+ "isUnique": false,
853+ "concurrently": false,
854+ "method": "btree",
855+ "with": {}
856+ }
857+ },
858+ "foreignKeys": {},
859+ "compositePrimaryKeys": {},
860+ "uniqueConstraints": {},
861+ "policies": {},
862+ "checkConstraints": {},
863+ "isRLSEnabled": false
864+ },
865+ "public.connector_backfills": {
866+ "name": "connector_backfills",
867+ "schema": "",
868+ "columns": {
869+ "id": {
870+ "name": "id",
871+ "type": "text",
872+ "primaryKey": true,
873+ "notNull": true
874+ },
875+ "connector_id": {
876+ "name": "connector_id",
877+ "type": "text",
878+ "primaryKey": false,
879+ "notNull": true
880+ },
881+ "status": {
882+ "name": "status",
883+ "type": "text",
884+ "primaryKey": false,
885+ "notNull": true,
886+ "default": "'running'"
887+ },
888+ "started_at": {
889+ "name": "started_at",
890+ "type": "timestamp with time zone",
891+ "primaryKey": false,
892+ "notNull": true
893+ },
894+ "updated_at": {
895+ "name": "updated_at",
896+ "type": "timestamp with time zone",
897+ "primaryKey": false,
898+ "notNull": true,
899+ "default": "now()"
900+ },
901+ "finished_at": {
902+ "name": "finished_at",
903+ "type": "timestamp with time zone",
904+ "primaryKey": false,
905+ "notNull": false
906+ },
907+ "backfill_start_date": {
908+ "name": "backfill_start_date",
909+ "type": "date",
910+ "primaryKey": false,
911+ "notNull": false
912+ },
913+ "backfill_end_date": {
914+ "name": "backfill_end_date",
915+ "type": "date",
916+ "primaryKey": false,
917+ "notNull": false
918+ },
919+ "reached_date": {
920+ "name": "reached_date",
921+ "type": "date",
922+ "primaryKey": false,
923+ "notNull": false
924+ },
925+ "pages_processed": {
926+ "name": "pages_processed",
927+ "type": "integer",
928+ "primaryKey": false,
929+ "notNull": true,
930+ "default": 0
931+ },
932+ "total_pages": {
933+ "name": "total_pages",
934+ "type": "integer",
935+ "primaryKey": false,
936+ "notNull": false
937+ },
938+ "items_processed": {
939+ "name": "items_processed",
940+ "type": "integer",
941+ "primaryKey": false,
942+ "notNull": true,
943+ "default": 0
944+ },
945+ "last_cursor": {
946+ "name": "last_cursor",
947+ "type": "jsonb",
948+ "primaryKey": false,
949+ "notNull": true,
950+ "default": "'{}'::jsonb"
951+ },
952+ "last_successful_page": {
953+ "name": "last_successful_page",
954+ "type": "integer",
955+ "primaryKey": false,
956+ "notNull": false
957+ },
958+ "runs": {
959+ "name": "runs",
960+ "type": "integer",
961+ "primaryKey": false,
962+ "notNull": true,
963+ "default": 0
964+ },
965+ "errors": {
966+ "name": "errors",
967+ "type": "integer",
968+ "primaryKey": false,
969+ "notNull": true,
970+ "default": 0
971+ },
972+ "retry_count": {
973+ "name": "retry_count",
974+ "type": "integer",
975+ "primaryKey": false,
976+ "notNull": true,
977+ "default": 0
978+ },
979+ "last_error": {
980+ "name": "last_error",
981+ "type": "text",
982+ "primaryKey": false,
983+ "notNull": false
984+ },
985+ "percent": {
986+ "name": "percent",
987+ "type": "real",
988+ "primaryKey": false,
989+ "notNull": false
990+ }
991+ },
992+ "indexes": {
993+ "connector_backfills_connector_idx": {
994+ "name": "connector_backfills_connector_idx",
995+ "columns": [
996+ {
997+ "expression": "connector_id",
998+ "isExpression": false,
999+ "asc": true,
1000+ "nulls": "last"
1001+ },
1002+ {
1003+ "expression": "status",
1004+ "isExpression": false,
1005+ "asc": true,
1006+ "nulls": "last"
1007+ }
1008+ ],
1009+ "isUnique": false,
1010+ "concurrently": false,
1011+ "method": "btree",
1012+ "with": {}
1013+ }
1014+ },
1015+ "foreignKeys": {},
1016+ "compositePrimaryKeys": {},
1017+ "uniqueConstraints": {},
1018+ "policies": {},
1019+ "checkConstraints": {},
1020+ "isRLSEnabled": false
1021+ },
1022+ "public.connector_field_stats": {
1023+ "name": "connector_field_stats",
1024+ "schema": "",
1025+ "columns": {
1026+ "connector_id": {
1027+ "name": "connector_id",
1028+ "type": "text",
1029+ "primaryKey": false,
1030+ "notNull": true
1031+ },
1032+ "day": {
1033+ "name": "day",
1034+ "type": "date",
1035+ "primaryKey": false,
1036+ "notNull": true
1037+ },
1038+ "field": {
1039+ "name": "field",
1040+ "type": "text",
1041+ "primaryKey": false,
1042+ "notNull": true
1043+ },
1044+ "total": {
1045+ "name": "total",
1046+ "type": "integer",
1047+ "primaryKey": false,
1048+ "notNull": true,
1049+ "default": 0
1050+ },
1051+ "nulls": {
1052+ "name": "nulls",
1053+ "type": "integer",
1054+ "primaryKey": false,
1055+ "notNull": true,
1056+ "default": 0
1057+ }
1058+ },
1059+ "indexes": {},
1060+ "foreignKeys": {},
1061+ "compositePrimaryKeys": {
1062+ "connector_field_stats_connector_id_day_field_pk": {
1063+ "name": "connector_field_stats_connector_id_day_field_pk",
1064+ "columns": [
1065+ "connector_id",
1066+ "day",
1067+ "field"
1068+ ]
1069+ }
1070+ },
1071+ "uniqueConstraints": {},
1072+ "policies": {},
1073+ "checkConstraints": {},
1074+ "isRLSEnabled": false
1075+ },
1076+ "public.connector_health": {
1077+ "name": "connector_health",
1078+ "schema": "",
1079+ "columns": {
1080+ "connector_id": {
1081+ "name": "connector_id",
1082+ "type": "text",
1083+ "primaryKey": true,
1084+ "notNull": true
1085+ },
1086+ "computed_at": {
1087+ "name": "computed_at",
1088+ "type": "timestamp with time zone",
1089+ "primaryKey": false,
1090+ "notNull": true
1091+ },
1092+ "status": {
1093+ "name": "status",
1094+ "type": "text",
1095+ "primaryKey": false,
1096+ "notNull": true
1097+ },
1098+ "health": {
1099+ "name": "health",
1100+ "type": "jsonb",
1101+ "primaryKey": false,
1102+ "notNull": true,
1103+ "default": "'{}'::jsonb"
1104+ }
1105+ },
1106+ "indexes": {},
1107+ "foreignKeys": {},
1108+ "compositePrimaryKeys": {},
1109+ "uniqueConstraints": {},
1110+ "policies": {},
1111+ "checkConstraints": {},
1112+ "isRLSEnabled": false
1113+ },
1114+ "public.connector_runs": {
1115+ "name": "connector_runs",
1116+ "schema": "",
1117+ "columns": {
1118+ "id": {
1119+ "name": "id",
1120+ "type": "text",
1121+ "primaryKey": true,
1122+ "notNull": true
1123+ },
1124+ "connector_id": {
1125+ "name": "connector_id",
1126+ "type": "text",
1127+ "primaryKey": false,
1128+ "notNull": true
1129+ },
1130+ "trigger": {
1131+ "name": "trigger",
1132+ "type": "text",
1133+ "primaryKey": false,
1134+ "notNull": true,
1135+ "default": "'schedule'"
1136+ },
1137+ "started_at": {
1138+ "name": "started_at",
1139+ "type": "timestamp with time zone",
1140+ "primaryKey": false,
1141+ "notNull": true
1142+ },
1143+ "finished_at": {
1144+ "name": "finished_at",
1145+ "type": "timestamp with time zone",
1146+ "primaryKey": false,
1147+ "notNull": false
1148+ },
1149+ "status": {
1150+ "name": "status",
1151+ "type": "text",
1152+ "primaryKey": false,
1153+ "notNull": true,
1154+ "default": "'running'"
1155+ },
1156+ "pages_attempted": {
1157+ "name": "pages_attempted",
1158+ "type": "integer",
1159+ "primaryKey": false,
1160+ "notNull": true,
1161+ "default": 0
1162+ },
1163+ "pages_success": {
1164+ "name": "pages_success",
1165+ "type": "integer",
1166+ "primaryKey": false,
1167+ "notNull": true,
1168+ "default": 0
1169+ },
1170+ "records_raw": {
1171+ "name": "records_raw",
1172+ "type": "integer",
1173+ "primaryKey": false,
1174+ "notNull": true,
1175+ "default": 0
1176+ },
1177+ "records_normalized": {
1178+ "name": "records_normalized",
1179+ "type": "integer",
1180+ "primaryKey": false,
1181+ "notNull": true,
1182+ "default": 0
1183+ },
1184+ "records_duplicate": {
1185+ "name": "records_duplicate",
1186+ "type": "integer",
1187+ "primaryKey": false,
1188+ "notNull": true,
1189+ "default": 0
1190+ },
1191+ "records_rejected": {
1192+ "name": "records_rejected",
1193+ "type": "integer",
1194+ "primaryKey": false,
1195+ "notNull": true,
1196+ "default": 0
1197+ },
1198+ "engine_stats": {
1199+ "name": "engine_stats",
1200+ "type": "jsonb",
1201+ "primaryKey": false,
1202+ "notNull": true,
1203+ "default": "'{}'::jsonb"
1204+ },
1205+ "anomalies": {
1206+ "name": "anomalies",
1207+ "type": "jsonb",
1208+ "primaryKey": false,
1209+ "notNull": true,
1210+ "default": "'[]'::jsonb"
1211+ },
1212+ "error": {
1213+ "name": "error",
1214+ "type": "text",
1215+ "primaryKey": false,
1216+ "notNull": false
1217+ },
1218+ "cost_credits": {
1219+ "name": "cost_credits",
1220+ "type": "real",
1221+ "primaryKey": false,
1222+ "notNull": true,
1223+ "default": 0
1224+ },
1225+ "cost_usd_est": {
1226+ "name": "cost_usd_est",
1227+ "type": "real",
1228+ "primaryKey": false,
1229+ "notNull": true,
1230+ "default": 0
1231+ },
1232+ "cursor": {
1233+ "name": "cursor",
1234+ "type": "jsonb",
1235+ "primaryKey": false,
1236+ "notNull": true,
1237+ "default": "'{}'::jsonb"
1238+ }
1239+ },
1240+ "indexes": {
1241+ "connector_runs_connector_started_idx": {
1242+ "name": "connector_runs_connector_started_idx",
1243+ "columns": [
1244+ {
1245+ "expression": "connector_id",
1246+ "isExpression": false,
1247+ "asc": true,
1248+ "nulls": "last"
1249+ },
1250+ {
1251+ "expression": "started_at",
1252+ "isExpression": false,
1253+ "asc": true,
1254+ "nulls": "last"
1255+ }
1256+ ],
1257+ "isUnique": false,
1258+ "concurrently": false,
1259+ "method": "btree",
1260+ "with": {}
1261+ }
1262+ },
1263+ "foreignKeys": {},
1264+ "compositePrimaryKeys": {},
1265+ "uniqueConstraints": {},
1266+ "policies": {},
1267+ "checkConstraints": {},
1268+ "isRLSEnabled": false
1269+ },
1270+ "public.connectors": {
1271+ "name": "connectors",
1272+ "schema": "",
1273+ "columns": {
1274+ "id": {
1275+ "name": "id",
1276+ "type": "text",
1277+ "primaryKey": true,
1278+ "notNull": true
1279+ },
1280+ "source_id": {
1281+ "name": "source_id",
1282+ "type": "text",
1283+ "primaryKey": false,
1284+ "notNull": true
1285+ },
1286+ "display_name": {
1287+ "name": "display_name",
1288+ "type": "text",
1289+ "primaryKey": false,
1290+ "notNull": true
1291+ },
1292+ "engine_priority": {
1293+ "name": "engine_priority",
1294+ "type": "text[]",
1295+ "primaryKey": false,
1296+ "notNull": true,
1297+ "default": "'{}'::text[]"
1298+ },
1299+ "categories": {
1300+ "name": "categories",
1301+ "type": "text[]",
1302+ "primaryKey": false,
1303+ "notNull": true,
1304+ "default": "'{}'::text[]"
1305+ },
1306+ "regions": {
1307+ "name": "regions",
1308+ "type": "text[]",
1309+ "primaryKey": false,
1310+ "notNull": true,
1311+ "default": "'{}'::text[]"
1312+ },
1313+ "languages": {
1314+ "name": "languages",
1315+ "type": "text[]",
1316+ "primaryKey": false,
1317+ "notNull": true,
1318+ "default": "'{}'::text[]"
1319+ },
1320+ "currency": {
1321+ "name": "currency",
1322+ "type": "text[]",
1323+ "primaryKey": false,
1324+ "notNull": true,
1325+ "default": "'{}'::text[]"
1326+ },
1327+ "supports_listings": {
1328+ "name": "supports_listings",
1329+ "type": "boolean",
1330+ "primaryKey": false,
1331+ "notNull": true,
1332+ "default": false
1333+ },
1334+ "supports_sold": {
1335+ "name": "supports_sold",
1336+ "type": "boolean",
1337+ "primaryKey": false,
1338+ "notNull": true,
1339+ "default": false
1340+ },
1341+ "supports_auctions": {
1342+ "name": "supports_auctions",
1343+ "type": "boolean",
1344+ "primaryKey": false,
1345+ "notNull": true,
1346+ "default": false
1347+ },
1348+ "supports_images": {
1349+ "name": "supports_images",
1350+ "type": "boolean",
1351+ "primaryKey": false,
1352+ "notNull": true,
1353+ "default": true
1354+ },
1355+ "supports_catalog": {
1356+ "name": "supports_catalog",
1357+ "type": "boolean",
1358+ "primaryKey": false,
1359+ "notNull": true,
1360+ "default": false
1361+ },
1362+ "supports_population": {
1363+ "name": "supports_population",
1364+ "type": "boolean",
1365+ "primaryKey": false,
1366+ "notNull": true,
1367+ "default": false
1368+ },
1369+ "refresh_frequency_minutes": {
1370+ "name": "refresh_frequency_minutes",
1371+ "type": "integer",
1372+ "primaryKey": false,
1373+ "notNull": true,
1374+ "default": 1440
1375+ },
1376+ "priority": {
1377+ "name": "priority",
1378+ "type": "text",
1379+ "primaryKey": false,
1380+ "notNull": true,
1381+ "default": "'medium'"
1382+ },
1383+ "status": {
1384+ "name": "status",
1385+ "type": "text",
1386+ "primaryKey": false,
1387+ "notNull": true,
1388+ "default": "'active'"
1389+ },
1390+ "schema_version": {
1391+ "name": "schema_version",
1392+ "type": "text",
1393+ "primaryKey": false,
1394+ "notNull": true,
1395+ "default": "'1.0'"
1396+ },
1397+ "connector_version": {
1398+ "name": "connector_version",
1399+ "type": "text",
1400+ "primaryKey": false,
1401+ "notNull": true,
1402+ "default": "'1.0.0'"
1403+ },
1404+ "config": {
1405+ "name": "config",
1406+ "type": "jsonb",
1407+ "primaryKey": false,
1408+ "notNull": true,
1409+ "default": "'{}'::jsonb"
1410+ },
1411+ "meta": {
1412+ "name": "meta",
1413+ "type": "jsonb",
1414+ "primaryKey": false,
1415+ "notNull": true,
1416+ "default": "'{}'::jsonb"
1417+ },
1418+ "last_run_at": {
1419+ "name": "last_run_at",
1420+ "type": "timestamp with time zone",
1421+ "primaryKey": false,
1422+ "notNull": false
1423+ },
1424+ "last_success_at": {
1425+ "name": "last_success_at",
1426+ "type": "timestamp with time zone",
1427+ "primaryKey": false,
1428+ "notNull": false
1429+ },
1430+ "next_run_at": {
1431+ "name": "next_run_at",
1432+ "type": "timestamp with time zone",
1433+ "primaryKey": false,
1434+ "notNull": false
1435+ },
1436+ "created_at": {
1437+ "name": "created_at",
1438+ "type": "timestamp with time zone",
1439+ "primaryKey": false,
1440+ "notNull": true,
1441+ "default": "now()"
1442+ },
1443+ "updated_at": {
1444+ "name": "updated_at",
1445+ "type": "timestamp with time zone",
1446+ "primaryKey": false,
1447+ "notNull": true,
1448+ "default": "now()"
1449+ }
1450+ },
1451+ "indexes": {},
1452+ "foreignKeys": {},
1453+ "compositePrimaryKeys": {},
1454+ "uniqueConstraints": {},
1455+ "policies": {},
1456+ "checkConstraints": {},
1457+ "isRLSEnabled": false
1458+ },
1459+ "public.costs": {
1460+ "name": "costs",
1461+ "schema": "",
1462+ "columns": {
1463+ "id": {
1464+ "name": "id",
1465+ "type": "text",
1466+ "primaryKey": true,
1467+ "notNull": true
1468+ },
1469+ "occurred_at": {
1470+ "name": "occurred_at",
1471+ "type": "timestamp with time zone",
1472+ "primaryKey": false,
1473+ "notNull": true
1474+ },
1475+ "kind": {
1476+ "name": "kind",
1477+ "type": "text",
1478+ "primaryKey": false,
1479+ "notNull": true
1480+ },
1481+ "provider": {
1482+ "name": "provider",
1483+ "type": "text",
1484+ "primaryKey": false,
1485+ "notNull": false
1486+ },
1487+ "connector_id": {
1488+ "name": "connector_id",
1489+ "type": "text",
1490+ "primaryKey": false,
1491+ "notNull": false
1492+ },
1493+ "category_slug": {
1494+ "name": "category_slug",
1495+ "type": "text",
1496+ "primaryKey": false,
1497+ "notNull": false
1498+ },
1499+ "endpoint": {
1500+ "name": "endpoint",
1501+ "type": "text",
1502+ "primaryKey": false,
1503+ "notNull": false
1504+ },
1505+ "user_id": {
1506+ "name": "user_id",
1507+ "type": "text",
1508+ "primaryKey": false,
1509+ "notNull": false
1510+ },
1511+ "units": {
1512+ "name": "units",
1513+ "type": "real",
1514+ "primaryKey": false,
1515+ "notNull": true,
1516+ "default": 1
1517+ },
1518+ "credits": {
1519+ "name": "credits",
1520+ "type": "real",
1521+ "primaryKey": false,
1522+ "notNull": true,
1523+ "default": 0
1524+ },
1525+ "usd_est": {
1526+ "name": "usd_est",
1527+ "type": "real",
1528+ "primaryKey": false,
1529+ "notNull": true,
1530+ "default": 0
1531+ },
1532+ "metadata": {
1533+ "name": "metadata",
1534+ "type": "jsonb",
1535+ "primaryKey": false,
1536+ "notNull": true,
1537+ "default": "'{}'::jsonb"
1538+ }
1539+ },
1540+ "indexes": {
1541+ "costs_occurred_idx": {
1542+ "name": "costs_occurred_idx",
1543+ "columns": [
1544+ {
1545+ "expression": "occurred_at",
1546+ "isExpression": false,
1547+ "asc": true,
1548+ "nulls": "last"
1549+ }
1550+ ],
1551+ "isUnique": false,
1552+ "concurrently": false,
1553+ "method": "btree",
1554+ "with": {}
1555+ },
1556+ "costs_connector_idx": {
1557+ "name": "costs_connector_idx",
1558+ "columns": [
1559+ {
1560+ "expression": "connector_id",
1561+ "isExpression": false,
1562+ "asc": true,
1563+ "nulls": "last"
1564+ }
1565+ ],
1566+ "isUnique": false,
1567+ "concurrently": false,
1568+ "method": "btree",
1569+ "with": {}
1570+ }
1571+ },
1572+ "foreignKeys": {},
1573+ "compositePrimaryKeys": {},
1574+ "uniqueConstraints": {},
1575+ "policies": {},
1576+ "checkConstraints": {},
1577+ "isRLSEnabled": false
1578+ },
1579+ "public.crawl_state": {
1580+ "name": "crawl_state",
1581+ "schema": "",
1582+ "columns": {
1583+ "url_hash": {
1584+ "name": "url_hash",
1585+ "type": "text",
1586+ "primaryKey": true,
1587+ "notNull": true
1588+ },
1589+ "connector_id": {
1590+ "name": "connector_id",
1591+ "type": "text",
1592+ "primaryKey": false,
1593+ "notNull": true
1594+ },
1595+ "url": {
1596+ "name": "url",
1597+ "type": "text",
1598+ "primaryKey": false,
1599+ "notNull": true
1600+ },
1601+ "etag": {
1602+ "name": "etag",
1603+ "type": "text",
1604+ "primaryKey": false,
1605+ "notNull": false
1606+ },
1607+ "last_modified": {
1608+ "name": "last_modified",
1609+ "type": "text",
1610+ "primaryKey": false,
1611+ "notNull": false
1612+ },
1613+ "content_hash": {
1614+ "name": "content_hash",
1615+ "type": "text",
1616+ "primaryKey": false,
1617+ "notNull": false
1618+ },
1619+ "last_fetched_at": {
1620+ "name": "last_fetched_at",
1621+ "type": "timestamp with time zone",
1622+ "primaryKey": false,
1623+ "notNull": false
1624+ },
1625+ "last_changed_at": {
1626+ "name": "last_changed_at",
1627+ "type": "timestamp with time zone",
1628+ "primaryKey": false,
1629+ "notNull": false
1630+ },
1631+ "fetch_count": {
1632+ "name": "fetch_count",
1633+ "type": "integer",
1634+ "primaryKey": false,
1635+ "notNull": true,
1636+ "default": 0
1637+ },
1638+ "change_count": {
1639+ "name": "change_count",
1640+ "type": "integer",
1641+ "primaryKey": false,
1642+ "notNull": true,
1643+ "default": 0
1644+ },
1645+ "change_interval_hours": {
1646+ "name": "change_interval_hours",
1647+ "type": "real",
1648+ "primaryKey": false,
1649+ "notNull": false
1650+ },
1651+ "next_fetch_at": {
1652+ "name": "next_fetch_at",
1653+ "type": "timestamp with time zone",
1654+ "primaryKey": false,
1655+ "notNull": false
1656+ },
1657+ "last_status": {
1658+ "name": "last_status",
1659+ "type": "integer",
1660+ "primaryKey": false,
1661+ "notNull": false
1662+ },
1663+ "failures": {
1664+ "name": "failures",
1665+ "type": "integer",
1666+ "primaryKey": false,
1667+ "notNull": true,
1668+ "default": 0
1669+ }
1670+ },
1671+ "indexes": {
1672+ "crawl_state_next_idx": {
1673+ "name": "crawl_state_next_idx",
1674+ "columns": [
1675+ {
1676+ "expression": "connector_id",
1677+ "isExpression": false,
1678+ "asc": true,
1679+ "nulls": "last"
1680+ },
1681+ {
1682+ "expression": "next_fetch_at",
1683+ "isExpression": false,
1684+ "asc": true,
1685+ "nulls": "last"
1686+ }
1687+ ],
1688+ "isUnique": false,
1689+ "concurrently": false,
1690+ "method": "btree",
1691+ "with": {}
1692+ }
1693+ },
1694+ "foreignKeys": {},
1695+ "compositePrimaryKeys": {},
1696+ "uniqueConstraints": {},
1697+ "policies": {},
1698+ "checkConstraints": {},
1699+ "isRLSEnabled": false
1700+ },
1701+ "public.sources": {
1702+ "name": "sources",
1703+ "schema": "",
1704+ "columns": {
1705+ "id": {
1706+ "name": "id",
1707+ "type": "text",
1708+ "primaryKey": true,
1709+ "notNull": true
1710+ },
1711+ "name": {
1712+ "name": "name",
1713+ "type": "text",
1714+ "primaryKey": false,
1715+ "notNull": true
1716+ },
1717+ "source_type": {
1718+ "name": "source_type",
1719+ "type": "text",
1720+ "primaryKey": false,
1721+ "notNull": true
1722+ },
1723+ "url": {
1724+ "name": "url",
1725+ "type": "text",
1726+ "primaryKey": false,
1727+ "notNull": false
1728+ },
1729+ "countries": {
1730+ "name": "countries",
1731+ "type": "text[]",
1732+ "primaryKey": false,
1733+ "notNull": true,
1734+ "default": "'{}'::text[]"
1735+ },
1736+ "languages": {
1737+ "name": "languages",
1738+ "type": "text[]",
1739+ "primaryKey": false,
1740+ "notNull": true,
1741+ "default": "'{}'::text[]"
1742+ },
1743+ "currencies": {
1744+ "name": "currencies",
1745+ "type": "text[]",
1746+ "primaryKey": false,
1747+ "notNull": true,
1748+ "default": "'{}'::text[]"
1749+ },
1750+ "trust_score": {
1751+ "name": "trust_score",
1752+ "type": "numeric(8, 6)",
1753+ "primaryKey": false,
1754+ "notNull": true,
1755+ "default": 0.5
1756+ },
1757+ "trust_factors": {
1758+ "name": "trust_factors",
1759+ "type": "jsonb",
1760+ "primaryKey": false,
1761+ "notNull": true,
1762+ "default": "'{}'::jsonb"
1763+ },
1764+ "attribution_required": {
1765+ "name": "attribution_required",
1766+ "type": "boolean",
1767+ "primaryKey": false,
1768+ "notNull": true,
1769+ "default": true
1770+ },
1771+ "terms_url": {
1772+ "name": "terms_url",
1773+ "type": "text",
1774+ "primaryKey": false,
1775+ "notNull": false
1776+ },
1777+ "active": {
1778+ "name": "active",
1779+ "type": "boolean",
1780+ "primaryKey": false,
1781+ "notNull": true,
1782+ "default": true
1783+ },
1784+ "created_at": {
1785+ "name": "created_at",
1786+ "type": "timestamp with time zone",
1787+ "primaryKey": false,
1788+ "notNull": true,
1789+ "default": "now()"
1790+ },
1791+ "updated_at": {
1792+ "name": "updated_at",
1793+ "type": "timestamp with time zone",
1794+ "primaryKey": false,
1795+ "notNull": true,
1796+ "default": "now()"
1797+ }
1798+ },
1799+ "indexes": {},
1800+ "foreignKeys": {},
1801+ "compositePrimaryKeys": {},
1802+ "uniqueConstraints": {},
1803+ "policies": {},
1804+ "checkConstraints": {},
1805+ "isRLSEnabled": false
1806+ },
1807+ "public.audit_log": {
1808+ "name": "audit_log",
1809+ "schema": "",
1810+ "columns": {
1811+ "id": {
1812+ "name": "id",
1813+ "type": "text",
1814+ "primaryKey": true,
1815+ "notNull": true
1816+ },
1817+ "entity_type": {
1818+ "name": "entity_type",
1819+ "type": "text",
1820+ "primaryKey": false,
1821+ "notNull": true
1822+ },
1823+ "entity_id": {
1824+ "name": "entity_id",
1825+ "type": "text",
1826+ "primaryKey": false,
1827+ "notNull": true
1828+ },
1829+ "action": {
1830+ "name": "action",
1831+ "type": "text",
1832+ "primaryKey": false,
1833+ "notNull": true
1834+ },
1835+ "reason": {
1836+ "name": "reason",
1837+ "type": "text",
1838+ "primaryKey": false,
1839+ "notNull": true
1840+ },
1841+ "actor": {
1842+ "name": "actor",
1843+ "type": "text",
1844+ "primaryKey": false,
1845+ "notNull": true,
1846+ "default": "'system'"
1847+ },
1848+ "details": {
1849+ "name": "details",
1850+ "type": "jsonb",
1851+ "primaryKey": false,
1852+ "notNull": true,
1853+ "default": "'{}'::jsonb"
1854+ },
1855+ "created_at": {
1856+ "name": "created_at",
1857+ "type": "timestamp with time zone",
1858+ "primaryKey": false,
1859+ "notNull": true,
1860+ "default": "now()"
1861+ }
1862+ },
1863+ "indexes": {
1864+ "audit_entity_idx": {
1865+ "name": "audit_entity_idx",
1866+ "columns": [
1867+ {
1868+ "expression": "entity_type",
1869+ "isExpression": false,
1870+ "asc": true,
1871+ "nulls": "last"
1872+ },
1873+ {
1874+ "expression": "entity_id",
1875+ "isExpression": false,
1876+ "asc": true,
1877+ "nulls": "last"
1878+ }
1879+ ],
1880+ "isUnique": false,
1881+ "concurrently": false,
1882+ "method": "btree",
1883+ "with": {}
1884+ }
1885+ },
1886+ "foreignKeys": {},
1887+ "compositePrimaryKeys": {},
1888+ "uniqueConstraints": {},
1889+ "policies": {},
1890+ "checkConstraints": {},
1891+ "isRLSEnabled": false
1892+ },
1893+ "public.events": {
1894+ "name": "events",
1895+ "schema": "",
1896+ "columns": {
1897+ "id": {
1898+ "name": "id",
1899+ "type": "text",
1900+ "primaryKey": true,
1901+ "notNull": true
1902+ },
1903+ "type": {
1904+ "name": "type",
1905+ "type": "text",
1906+ "primaryKey": false,
1907+ "notNull": true
1908+ },
1909+ "entity_type": {
1910+ "name": "entity_type",
1911+ "type": "text",
1912+ "primaryKey": false,
1913+ "notNull": false
1914+ },
1915+ "entity_id": {
1916+ "name": "entity_id",
1917+ "type": "text",
1918+ "primaryKey": false,
1919+ "notNull": false
1920+ },
1921+ "payload": {
1922+ "name": "payload",
1923+ "type": "jsonb",
1924+ "primaryKey": false,
1925+ "notNull": true,
1926+ "default": "'{}'::jsonb"
1927+ },
1928+ "created_at": {
1929+ "name": "created_at",
1930+ "type": "timestamp with time zone",
1931+ "primaryKey": false,
1932+ "notNull": true,
1933+ "default": "now()"
1934+ }
1935+ },
1936+ "indexes": {
1937+ "events_type_created_idx": {
1938+ "name": "events_type_created_idx",
1939+ "columns": [
1940+ {
1941+ "expression": "type",
1942+ "isExpression": false,
1943+ "asc": true,
1944+ "nulls": "last"
1945+ },
1946+ {
1947+ "expression": "created_at",
1948+ "isExpression": false,
1949+ "asc": true,
1950+ "nulls": "last"
1951+ }
1952+ ],
1953+ "isUnique": false,
1954+ "concurrently": false,
1955+ "method": "btree",
1956+ "with": {}
1957+ },
1958+ "events_entity_idx": {
1959+ "name": "events_entity_idx",
1960+ "columns": [
1961+ {
1962+ "expression": "entity_type",
1963+ "isExpression": false,
1964+ "asc": true,
1965+ "nulls": "last"
1966+ },
1967+ {
1968+ "expression": "entity_id",
1969+ "isExpression": false,
1970+ "asc": true,
1971+ "nulls": "last"
1972+ }
1973+ ],
1974+ "isUnique": false,
1975+ "concurrently": false,
1976+ "method": "btree",
1977+ "with": {}
1978+ }
1979+ },
1980+ "foreignKeys": {},
1981+ "compositePrimaryKeys": {},
1982+ "uniqueConstraints": {},
1983+ "policies": {},
1984+ "checkConstraints": {},
1985+ "isRLSEnabled": false
1986+ },
1987+ "public.normalized_records": {
1988+ "name": "normalized_records",
1989+ "schema": "",
1990+ "columns": {
1991+ "id": {
1992+ "name": "id",
1993+ "type": "text",
1994+ "primaryKey": true,
1995+ "notNull": true
1996+ },
1997+ "raw_record_id": {
1998+ "name": "raw_record_id",
1999+ "type": "text",
2000+ "primaryKey": false,
2001+ "notNull": true
2002+ },
2003+ "connector_id": {
2004+ "name": "connector_id",
2005+ "type": "text",
2006+ "primaryKey": false,
2007+ "notNull": true
2008+ },
2009+ "source_id": {
2010+ "name": "source_id",
2011+ "type": "text",
2012+ "primaryKey": false,
2013+ "notNull": true
2014+ },
2015+ "kind": {
2016+ "name": "kind",
2017+ "type": "text",
2018+ "primaryKey": false,
2019+ "notNull": true
2020+ },
2021+ "payload": {
2022+ "name": "payload",
2023+ "type": "jsonb",
2024+ "primaryKey": false,
2025+ "notNull": true
2026+ },
2027+ "seq": {
2028+ "name": "seq",
2029+ "type": "integer",
2030+ "primaryKey": false,
2031+ "notNull": true,
2032+ "default": 0
2033+ },
2034+ "asset_id": {
2035+ "name": "asset_id",
2036+ "type": "text",
2037+ "primaryKey": false,
2038+ "notNull": false
2039+ },
2040+ "variant_id": {
2041+ "name": "variant_id",
2042+ "type": "text",
2043+ "primaryKey": false,
2044+ "notNull": false
2045+ },
2046+ "match_method": {
2047+ "name": "match_method",
2048+ "type": "text",
2049+ "primaryKey": false,
2050+ "notNull": false
2051+ },
2052+ "match_confidence": {
2053+ "name": "match_confidence",
2054+ "type": "numeric(8, 6)",
2055+ "primaryKey": false,
2056+ "notNull": false
2057+ },
2058+ "status": {
2059+ "name": "status",
2060+ "type": "text",
2061+ "primaryKey": false,
2062+ "notNull": true,
2063+ "default": "'pending'"
2064+ },
2065+ "reject_reason": {
2066+ "name": "reject_reason",
2067+ "type": "text",
2068+ "primaryKey": false,
2069+ "notNull": false
2070+ },
2071+ "target_id": {
2072+ "name": "target_id",
2073+ "type": "text",
2074+ "primaryKey": false,
2075+ "notNull": false
2076+ },
2077+ "created_at": {
2078+ "name": "created_at",
2079+ "type": "timestamp with time zone",
2080+ "primaryKey": false,
2081+ "notNull": true,
2082+ "default": "now()"
2083+ },
2084+ "processed_at": {
2085+ "name": "processed_at",
2086+ "type": "timestamp with time zone",
2087+ "primaryKey": false,
2088+ "notNull": false
2089+ }
2090+ },
2091+ "indexes": {
2092+ "normalized_records_status_idx": {
2093+ "name": "normalized_records_status_idx",
2094+ "columns": [
2095+ {
2096+ "expression": "status",
2097+ "isExpression": false,
2098+ "asc": true,
2099+ "nulls": "last"
2100+ },
2101+ {
2102+ "expression": "created_at",
2103+ "isExpression": false,
2104+ "asc": true,
2105+ "nulls": "last"
2106+ }
2107+ ],
2108+ "isUnique": false,
2109+ "concurrently": false,
2110+ "method": "btree",
2111+ "with": {}
2112+ },
2113+ "normalized_records_status_kind_idx": {
2114+ "name": "normalized_records_status_kind_idx",
2115+ "columns": [
2116+ {
2117+ "expression": "status",
2118+ "isExpression": false,
2119+ "asc": true,
2120+ "nulls": "last"
2121+ },
2122+ {
2123+ "expression": "kind",
2124+ "isExpression": false,
2125+ "asc": true,
2126+ "nulls": "last"
2127+ },
2128+ {
2129+ "expression": "created_at",
2130+ "isExpression": false,
2131+ "asc": true,
2132+ "nulls": "last"
2133+ }
2134+ ],
2135+ "isUnique": false,
2136+ "concurrently": false,
2137+ "method": "btree",
2138+ "with": {}
2139+ },
2140+ "normalized_records_asset_idx": {
2141+ "name": "normalized_records_asset_idx",
2142+ "columns": [
2143+ {
2144+ "expression": "asset_id",
2145+ "isExpression": false,
2146+ "asc": true,
2147+ "nulls": "last"
2148+ }
2149+ ],
2150+ "isUnique": false,
2151+ "concurrently": false,
2152+ "method": "btree",
2153+ "with": {}
2154+ },
2155+ "normalized_records_raw_uq": {
2156+ "name": "normalized_records_raw_uq",
2157+ "columns": [
2158+ {
2159+ "expression": "raw_record_id",
2160+ "isExpression": false,
2161+ "asc": true,
2162+ "nulls": "last"
2163+ },
2164+ {
2165+ "expression": "kind",
2166+ "isExpression": false,
2167+ "asc": true,
2168+ "nulls": "last"
2169+ },
2170+ {
2171+ "expression": "seq",
2172+ "isExpression": false,
2173+ "asc": true,
2174+ "nulls": "last"
2175+ }
2176+ ],
2177+ "isUnique": true,
2178+ "concurrently": false,
2179+ "method": "btree",
2180+ "with": {}
2181+ }
2182+ },
2183+ "foreignKeys": {},
2184+ "compositePrimaryKeys": {},
2185+ "uniqueConstraints": {},
2186+ "policies": {},
2187+ "checkConstraints": {},
2188+ "isRLSEnabled": false
2189+ },
2190+ "public.raw_records": {
2191+ "name": "raw_records",
2192+ "schema": "",
2193+ "columns": {
2194+ "id": {
2195+ "name": "id",
2196+ "type": "text",
2197+ "primaryKey": true,
2198+ "notNull": true
2199+ },
2200+ "connector_id": {
2201+ "name": "connector_id",
2202+ "type": "text",
2203+ "primaryKey": false,
2204+ "notNull": true
2205+ },
2206+ "source_id": {
2207+ "name": "source_id",
2208+ "type": "text",
2209+ "primaryKey": false,
2210+ "notNull": true
2211+ },
2212+ "run_id": {
2213+ "name": "run_id",
2214+ "type": "text",
2215+ "primaryKey": false,
2216+ "notNull": false
2217+ },
2218+ "engine": {
2219+ "name": "engine",
2220+ "type": "text",
2221+ "primaryKey": false,
2222+ "notNull": true
2223+ },
2224+ "url": {
2225+ "name": "url",
2226+ "type": "text",
2227+ "primaryKey": false,
2228+ "notNull": true
2229+ },
2230+ "external_id": {
2231+ "name": "external_id",
2232+ "type": "text",
2233+ "primaryKey": false,
2234+ "notNull": false
2235+ },
2236+ "kind": {
2237+ "name": "kind",
2238+ "type": "text",
2239+ "primaryKey": false,
2240+ "notNull": true
2241+ },
2242+ "fetched_at": {
2243+ "name": "fetched_at",
2244+ "type": "timestamp with time zone",
2245+ "primaryKey": false,
2246+ "notNull": true
2247+ },
2248+ "content_hash": {
2249+ "name": "content_hash",
2250+ "type": "text",
2251+ "primaryKey": false,
2252+ "notNull": true
2253+ },
2254+ "http_status": {
2255+ "name": "http_status",
2256+ "type": "integer",
2257+ "primaryKey": false,
2258+ "notNull": false
2259+ },
2260+ "payload": {
2261+ "name": "payload",
2262+ "type": "jsonb",
2263+ "primaryKey": false,
2264+ "notNull": true
2265+ },
2266+ "snapshot_ref": {
2267+ "name": "snapshot_ref",
2268+ "type": "text",
2269+ "primaryKey": false,
2270+ "notNull": false
2271+ },
2272+ "parser_version": {
2273+ "name": "parser_version",
2274+ "type": "text",
2275+ "primaryKey": false,
2276+ "notNull": true
2277+ },
2278+ "connector_version": {
2279+ "name": "connector_version",
2280+ "type": "text",
2281+ "primaryKey": false,
2282+ "notNull": true
2283+ },
2284+ "processed_at": {
2285+ "name": "processed_at",
2286+ "type": "timestamp with time zone",
2287+ "primaryKey": false,
2288+ "notNull": false
2289+ },
2290+ "process_error": {
2291+ "name": "process_error",
2292+ "type": "text",
2293+ "primaryKey": false,
2294+ "notNull": false
2295+ },
2296+ "created_at": {
2297+ "name": "created_at",
2298+ "type": "timestamp with time zone",
2299+ "primaryKey": false,
2300+ "notNull": true,
2301+ "default": "now()"
2302+ }
2303+ },
2304+ "indexes": {
2305+ "raw_records_connector_hash_uq": {
2306+ "name": "raw_records_connector_hash_uq",
2307+ "columns": [
2308+ {
2309+ "expression": "connector_id",
2310+ "isExpression": false,
2311+ "asc": true,
2312+ "nulls": "last"
2313+ },
2314+ {
2315+ "expression": "content_hash",
2316+ "isExpression": false,
2317+ "asc": true,
2318+ "nulls": "last"
2319+ }
2320+ ],
2321+ "isUnique": true,
2322+ "concurrently": false,
2323+ "method": "btree",
2324+ "with": {}
2325+ },
2326+ "raw_records_connector_fetched_idx": {
2327+ "name": "raw_records_connector_fetched_idx",
2328+ "columns": [
2329+ {
2330+ "expression": "connector_id",
2331+ "isExpression": false,
2332+ "asc": true,
2333+ "nulls": "last"
2334+ },
2335+ {
2336+ "expression": "fetched_at",
2337+ "isExpression": false,
2338+ "asc": true,
2339+ "nulls": "last"
2340+ }
2341+ ],
2342+ "isUnique": false,
2343+ "concurrently": false,
2344+ "method": "btree",
2345+ "with": {}
2346+ },
2347+ "raw_records_unprocessed_idx": {
2348+ "name": "raw_records_unprocessed_idx",
2349+ "columns": [
2350+ {
2351+ "expression": "processed_at",
2352+ "isExpression": false,
2353+ "asc": true,
2354+ "nulls": "last"
2355+ }
2356+ ],
2357+ "isUnique": false,
2358+ "concurrently": false,
2359+ "method": "btree",
2360+ "with": {}
2361+ },
2362+ "raw_records_external_idx": {
2363+ "name": "raw_records_external_idx",
2364+ "columns": [
2365+ {
2366+ "expression": "connector_id",
2367+ "isExpression": false,
2368+ "asc": true,
2369+ "nulls": "last"
2370+ },
2371+ {
2372+ "expression": "external_id",
2373+ "isExpression": false,
2374+ "asc": true,
2375+ "nulls": "last"
2376+ }
2377+ ],
2378+ "isUnique": false,
2379+ "concurrently": false,
2380+ "method": "btree",
2381+ "with": {}
2382+ }
2383+ },
2384+ "foreignKeys": {},
2385+ "compositePrimaryKeys": {},
2386+ "uniqueConstraints": {},
2387+ "policies": {},
2388+ "checkConstraints": {},
2389+ "isRLSEnabled": false
2390+ },
2391+ "public.asset_embeddings": {
2392+ "name": "asset_embeddings",
2393+ "schema": "",
2394+ "columns": {
2395+ "asset_id": {
2396+ "name": "asset_id",
2397+ "type": "text",
2398+ "primaryKey": true,
2399+ "notNull": true
2400+ },
2401+ "model": {
2402+ "name": "model",
2403+ "type": "text",
2404+ "primaryKey": false,
2405+ "notNull": true
2406+ },
2407+ "embedding": {
2408+ "name": "embedding",
2409+ "type": "vector(1536)",
2410+ "primaryKey": false,
2411+ "notNull": true
2412+ },
2413+ "updated_at": {
2414+ "name": "updated_at",
2415+ "type": "timestamp with time zone",
2416+ "primaryKey": false,
2417+ "notNull": true,
2418+ "default": "now()"
2419+ }
2420+ },
2421+ "indexes": {},
2422+ "foreignKeys": {},
2423+ "compositePrimaryKeys": {},
2424+ "uniqueConstraints": {},
2425+ "policies": {},
2426+ "checkConstraints": {},
2427+ "isRLSEnabled": false
2428+ },
2429+ "public.asset_stats": {
2430+ "name": "asset_stats",
2431+ "schema": "",
2432+ "columns": {
2433+ "asset_id": {
2434+ "name": "asset_id",
2435+ "type": "text",
2436+ "primaryKey": true,
2437+ "notNull": true
2438+ },
2439+ "riv_usd": {
2440+ "name": "riv_usd",
2441+ "type": "numeric(18, 4)",
2442+ "primaryKey": false,
2443+ "notNull": false
2444+ },
2445+ "riv_low_usd": {
2446+ "name": "riv_low_usd",
2447+ "type": "numeric(18, 4)",
2448+ "primaryKey": false,
2449+ "notNull": false
2450+ },
2451+ "riv_high_usd": {
2452+ "name": "riv_high_usd",
2453+ "type": "numeric(18, 4)",
2454+ "primaryKey": false,
2455+ "notNull": false
2456+ },
2457+ "riv_confidence": {
2458+ "name": "riv_confidence",
2459+ "type": "numeric(8, 6)",
2460+ "primaryKey": false,
2461+ "notNull": false
2462+ },
2463+ "riv_sample_size": {
2464+ "name": "riv_sample_size",
2465+ "type": "integer",
2466+ "primaryKey": false,
2467+ "notNull": true,
2468+ "default": 0
2469+ },
2470+ "riv_variant_id": {
2471+ "name": "riv_variant_id",
2472+ "type": "text",
2473+ "primaryKey": false,
2474+ "notNull": false
2475+ },
2476+ "latest_sale_usd": {
2477+ "name": "latest_sale_usd",
2478+ "type": "numeric(18, 4)",
2479+ "primaryKey": false,
2480+ "notNull": false
2481+ },
2482+ "latest_sale_at": {
2483+ "name": "latest_sale_at",
2484+ "type": "timestamp with time zone",
2485+ "primaryKey": false,
2486+ "notNull": false
2487+ },
2488+ "change_1d": {
2489+ "name": "change_1d",
2490+ "type": "numeric(8, 6)",
2491+ "primaryKey": false,
2492+ "notNull": false
2493+ },
2494+ "change_7d": {
2495+ "name": "change_7d",
2496+ "type": "numeric(8, 6)",
2497+ "primaryKey": false,
2498+ "notNull": false
2499+ },
2500+ "change_30d": {
2501+ "name": "change_30d",
2502+ "type": "numeric(8, 6)",
2503+ "primaryKey": false,
2504+ "notNull": false
2505+ },
2506+ "change_90d": {
2507+ "name": "change_90d",
2508+ "type": "numeric(8, 6)",
2509+ "primaryKey": false,
2510+ "notNull": false
2511+ },
2512+ "change_1y": {
2513+ "name": "change_1y",
2514+ "type": "numeric(8, 6)",
2515+ "primaryKey": false,
2516+ "notNull": false
2517+ },
2518+ "ath_usd": {
2519+ "name": "ath_usd",
2520+ "type": "numeric(18, 4)",
2521+ "primaryKey": false,
2522+ "notNull": false
2523+ },
2524+ "ath_at": {
2525+ "name": "ath_at",
2526+ "type": "timestamp with time zone",
2527+ "primaryKey": false,
2528+ "notNull": false
2529+ },
2530+ "atl_usd": {
2531+ "name": "atl_usd",
2532+ "type": "numeric(18, 4)",
2533+ "primaryKey": false,
2534+ "notNull": false
2535+ },
2536+ "atl_at": {
2537+ "name": "atl_at",
2538+ "type": "timestamp with time zone",
2539+ "primaryKey": false,
2540+ "notNull": false
2541+ },
2542+ "sales_count": {
2543+ "name": "sales_count",
2544+ "type": "integer",
2545+ "primaryKey": false,
2546+ "notNull": true,
2547+ "default": 0
2548+ },
2549+ "sales_30d": {
2550+ "name": "sales_30d",
2551+ "type": "integer",
2552+ "primaryKey": false,
2553+ "notNull": true,
2554+ "default": 0
2555+ },
2556+ "sales_1y": {
2557+ "name": "sales_1y",
2558+ "type": "integer",
2559+ "primaryKey": false,
2560+ "notNull": true,
2561+ "default": 0
2562+ },
2563+ "volume_30d_usd": {
2564+ "name": "volume_30d_usd",
2565+ "type": "numeric(18, 4)",
2566+ "primaryKey": false,
2567+ "notNull": false
2568+ },
2569+ "active_listings": {
2570+ "name": "active_listings",
2571+ "type": "integer",
2572+ "primaryKey": false,
2573+ "notNull": true,
2574+ "default": 0
2575+ },
2576+ "min_ask_usd": {
2577+ "name": "min_ask_usd",
2578+ "type": "numeric(18, 4)",
2579+ "primaryKey": false,
2580+ "notNull": false
2581+ },
2582+ "observations_count": {
2583+ "name": "observations_count",
2584+ "type": "integer",
2585+ "primaryKey": false,
2586+ "notNull": true,
2587+ "default": 0
2588+ },
2589+ "sources_count": {
2590+ "name": "sources_count",
2591+ "type": "integer",
2592+ "primaryKey": false,
2593+ "notNull": true,
2594+ "default": 0
2595+ },
2596+ "liquidity_score": {
2597+ "name": "liquidity_score",
2598+ "type": "real",
2599+ "primaryKey": false,
2600+ "notNull": false
2601+ },
2602+ "rarity_score": {
2603+ "name": "rarity_score",
2604+ "type": "real",
2605+ "primaryKey": false,
2606+ "notNull": false
2607+ },
2608+ "momentum_7d": {
2609+ "name": "momentum_7d",
2610+ "type": "real",
2611+ "primaryKey": false,
2612+ "notNull": false
2613+ },
2614+ "momentum_30d": {
2615+ "name": "momentum_30d",
2616+ "type": "real",
2617+ "primaryKey": false,
2618+ "notNull": false
2619+ },
2620+ "momentum_90d": {
2621+ "name": "momentum_90d",
2622+ "type": "real",
2623+ "primaryKey": false,
2624+ "notNull": false
2625+ },
2626+ "momentum_1y": {
2627+ "name": "momentum_1y",
2628+ "type": "real",
2629+ "primaryKey": false,
2630+ "notNull": false
2631+ },
2632+ "trending_score": {
2633+ "name": "trending_score",
2634+ "type": "real",
2635+ "primaryKey": false,
2636+ "notNull": false
2637+ },
2638+ "value_opportunity": {
2639+ "name": "value_opportunity",
2640+ "type": "real",
2641+ "primaryKey": false,
2642+ "notNull": false
2643+ },
2644+ "data_quality": {
2645+ "name": "data_quality",
2646+ "type": "real",
2647+ "primaryKey": false,
2648+ "notNull": false
2649+ },
2650+ "watchers": {
2651+ "name": "watchers",
2652+ "type": "integer",
2653+ "primaryKey": false,
2654+ "notNull": true,
2655+ "default": 0
2656+ },
2657+ "views_30d": {
2658+ "name": "views_30d",
2659+ "type": "integer",
2660+ "primaryKey": false,
2661+ "notNull": true,
2662+ "default": 0
2663+ },
2664+ "updated_at": {
2665+ "name": "updated_at",
2666+ "type": "timestamp with time zone",
2667+ "primaryKey": false,
2668+ "notNull": true,
2669+ "default": "now()"
2670+ }
2671+ },
2672+ "indexes": {
2673+ "asset_stats_riv_idx": {
2674+ "name": "asset_stats_riv_idx",
2675+ "columns": [
2676+ {
2677+ "expression": "riv_usd",
2678+ "isExpression": false,
2679+ "asc": true,
2680+ "nulls": "last"
2681+ }
2682+ ],
2683+ "isUnique": false,
2684+ "concurrently": false,
2685+ "method": "btree",
2686+ "with": {}
2687+ },
2688+ "asset_stats_trending_idx": {
2689+ "name": "asset_stats_trending_idx",
2690+ "columns": [
2691+ {
2692+ "expression": "trending_score",
2693+ "isExpression": false,
2694+ "asc": true,
2695+ "nulls": "last"
2696+ }
2697+ ],
2698+ "isUnique": false,
2699+ "concurrently": false,
2700+ "method": "btree",
2701+ "with": {}
2702+ },
2703+ "asset_stats_liquidity_idx": {
2704+ "name": "asset_stats_liquidity_idx",
2705+ "columns": [
2706+ {
2707+ "expression": "liquidity_score",
2708+ "isExpression": false,
2709+ "asc": true,
2710+ "nulls": "last"
2711+ }
2712+ ],
2713+ "isUnique": false,
2714+ "concurrently": false,
2715+ "method": "btree",
2716+ "with": {}
2717+ },
2718+ "asset_stats_change_7d_idx": {
2719+ "name": "asset_stats_change_7d_idx",
2720+ "columns": [
2721+ {
2722+ "expression": "change_7d",
2723+ "isExpression": false,
2724+ "asc": true,
2725+ "nulls": "last"
2726+ }
2727+ ],
2728+ "isUnique": false,
2729+ "concurrently": false,
2730+ "method": "btree",
2731+ "with": {}
2732+ },
2733+ "asset_stats_change_30d_idx": {
2734+ "name": "asset_stats_change_30d_idx",
2735+ "columns": [
2736+ {
2737+ "expression": "change_30d",
2738+ "isExpression": false,
2739+ "asc": true,
2740+ "nulls": "last"
2741+ }
2742+ ],
2743+ "isUnique": false,
2744+ "concurrently": false,
2745+ "method": "btree",
2746+ "with": {}
2747+ },
2748+ "asset_stats_change_1y_idx": {
2749+ "name": "asset_stats_change_1y_idx",
2750+ "columns": [
2751+ {
2752+ "expression": "change_1y",
2753+ "isExpression": false,
2754+ "asc": true,
2755+ "nulls": "last"
2756+ }
2757+ ],
2758+ "isUnique": false,
2759+ "concurrently": false,
2760+ "method": "btree",
2761+ "with": {}
2762+ },
2763+ "asset_stats_opportunity_idx": {
2764+ "name": "asset_stats_opportunity_idx",
2765+ "columns": [
2766+ {
2767+ "expression": "value_opportunity",
2768+ "isExpression": false,
2769+ "asc": true,
2770+ "nulls": "last"
2771+ }
2772+ ],
2773+ "isUnique": false,
2774+ "where": "value_opportunity is not null",
2775+ "concurrently": false,
2776+ "method": "btree",
2777+ "with": {}
2778+ },
2779+ "asset_stats_sales_30d_idx": {
2780+ "name": "asset_stats_sales_30d_idx",
2781+ "columns": [
2782+ {
2783+ "expression": "sales_30d",
2784+ "isExpression": false,
2785+ "asc": true,
2786+ "nulls": "last"
2787+ }
2788+ ],
2789+ "isUnique": false,
2790+ "concurrently": false,
2791+ "method": "btree",
2792+ "with": {}
2793+ }
2794+ },
2795+ "foreignKeys": {},
2796+ "compositePrimaryKeys": {},
2797+ "uniqueConstraints": {},
2798+ "policies": {},
2799+ "checkConstraints": {},
2800+ "isRLSEnabled": false
2801+ },
2802+ "public.asset_variants": {
2803+ "name": "asset_variants",
2804+ "schema": "",
2805+ "columns": {
2806+ "id": {
2807+ "name": "id",
2808+ "type": "text",
2809+ "primaryKey": true,
2810+ "notNull": true
2811+ },
2812+ "asset_id": {
2813+ "name": "asset_id",
2814+ "type": "text",
2815+ "primaryKey": false,
2816+ "notNull": true
2817+ },
2818+ "variant_key": {
2819+ "name": "variant_key",
2820+ "type": "text",
2821+ "primaryKey": false,
2822+ "notNull": true
2823+ },
2824+ "grader": {
2825+ "name": "grader",
2826+ "type": "text",
2827+ "primaryKey": false,
2828+ "notNull": false
2829+ },
2830+ "grade": {
2831+ "name": "grade",
2832+ "type": "text",
2833+ "primaryKey": false,
2834+ "notNull": false
2835+ },
2836+ "qualifier": {
2837+ "name": "qualifier",
2838+ "type": "text",
2839+ "primaryKey": false,
2840+ "notNull": false
2841+ },
2842+ "condition": {
2843+ "name": "condition",
2844+ "type": "text",
2845+ "primaryKey": false,
2846+ "notNull": false
2847+ },
2848+ "completeness": {
2849+ "name": "completeness",
2850+ "type": "text",
2851+ "primaryKey": false,
2852+ "notNull": false
2853+ },
2854+ "size_label": {
2855+ "name": "size_label",
2856+ "type": "text",
2857+ "primaryKey": false,
2858+ "notNull": false
2859+ },
2860+ "label": {
2861+ "name": "label",
2862+ "type": "text",
2863+ "primaryKey": false,
2864+ "notNull": true
2865+ },
2866+ "is_default": {
2867+ "name": "is_default",
2868+ "type": "boolean",
2869+ "primaryKey": false,
2870+ "notNull": true,
2871+ "default": false
2872+ },
2873+ "created_at": {
2874+ "name": "created_at",
2875+ "type": "timestamp with time zone",
2876+ "primaryKey": false,
2877+ "notNull": true,
2878+ "default": "now()"
2879+ }
2880+ },
2881+ "indexes": {
2882+ "asset_variants_uq": {
2883+ "name": "asset_variants_uq",
2884+ "columns": [
2885+ {
2886+ "expression": "asset_id",
2887+ "isExpression": false,
2888+ "asc": true,
2889+ "nulls": "last"
2890+ },
2891+ {
2892+ "expression": "variant_key",
2893+ "isExpression": false,
2894+ "asc": true,
2895+ "nulls": "last"
2896+ }
2897+ ],
2898+ "isUnique": true,
2899+ "concurrently": false,
2900+ "method": "btree",
2901+ "with": {}
2902+ },
2903+ "asset_variants_asset_idx": {
2904+ "name": "asset_variants_asset_idx",
2905+ "columns": [
2906+ {
2907+ "expression": "asset_id",
2908+ "isExpression": false,
2909+ "asc": true,
2910+ "nulls": "last"
2911+ }
2912+ ],
2913+ "isUnique": false,
2914+ "concurrently": false,
2915+ "method": "btree",
2916+ "with": {}
2917+ }
2918+ },
2919+ "foreignKeys": {},
2920+ "compositePrimaryKeys": {},
2921+ "uniqueConstraints": {},
2922+ "policies": {},
2923+ "checkConstraints": {},
2924+ "isRLSEnabled": false
2925+ },
2926+ "public.assets": {
2927+ "name": "assets",
2928+ "schema": "",
2929+ "columns": {
2930+ "id": {
2931+ "name": "id",
2932+ "type": "text",
2933+ "primaryKey": true,
2934+ "notNull": true
2935+ },
2936+ "slug": {
2937+ "name": "slug",
2938+ "type": "text",
2939+ "primaryKey": false,
2940+ "notNull": true
2941+ },
2942+ "canonical_key": {
2943+ "name": "canonical_key",
2944+ "type": "text",
2945+ "primaryKey": false,
2946+ "notNull": true
2947+ },
2948+ "category_slug": {
2949+ "name": "category_slug",
2950+ "type": "text",
2951+ "primaryKey": false,
2952+ "notNull": true
2953+ },
2954+ "subcategory_slug": {
2955+ "name": "subcategory_slug",
2956+ "type": "text",
2957+ "primaryKey": false,
2958+ "notNull": false
2959+ },
2960+ "family_slug": {
2961+ "name": "family_slug",
2962+ "type": "text",
2963+ "primaryKey": false,
2964+ "notNull": true
2965+ },
2966+ "franchise": {
2967+ "name": "franchise",
2968+ "type": "text",
2969+ "primaryKey": false,
2970+ "notNull": false
2971+ },
2972+ "brand": {
2973+ "name": "brand",
2974+ "type": "text",
2975+ "primaryKey": false,
2976+ "notNull": false
2977+ },
2978+ "series": {
2979+ "name": "series",
2980+ "type": "text",
2981+ "primaryKey": false,
2982+ "notNull": false
2983+ },
2984+ "set_slug": {
2985+ "name": "set_slug",
2986+ "type": "text",
2987+ "primaryKey": false,
2988+ "notNull": false
2989+ },
2990+ "set_name": {
2991+ "name": "set_name",
2992+ "type": "text",
2993+ "primaryKey": false,
2994+ "notNull": false
2995+ },
2996+ "set_code": {
2997+ "name": "set_code",
2998+ "type": "text",
2999+ "primaryKey": false,
3000+ "notNull": false
3001+ },
3002+ "name": {
3003+ "name": "name",
3004+ "type": "text",
3005+ "primaryKey": false,
3006+ "notNull": true
3007+ },
3008+ "title": {
3009+ "name": "title",
3010+ "type": "text",
3011+ "primaryKey": false,
3012+ "notNull": true
3013+ },
3014+ "model": {
3015+ "name": "model",
3016+ "type": "text",
3017+ "primaryKey": false,
3018+ "notNull": false
3019+ },
3020+ "reference": {
3021+ "name": "reference",
3022+ "type": "text",
3023+ "primaryKey": false,
3024+ "notNull": false
3025+ },
3026+ "number": {
3027+ "name": "number",
3028+ "type": "text",
3029+ "primaryKey": false,
3030+ "notNull": false
3031+ },
3032+ "year": {
3033+ "name": "year",
3034+ "type": "integer",
3035+ "primaryKey": false,
3036+ "notNull": false
3037+ },
3038+ "edition": {
3039+ "name": "edition",
3040+ "type": "text",
3041+ "primaryKey": false,
3042+ "notNull": false
3043+ },
3044+ "variant": {
3045+ "name": "variant",
3046+ "type": "text",
3047+ "primaryKey": false,
3048+ "notNull": false
3049+ },
3050+ "language": {
3051+ "name": "language",
3052+ "type": "text",
3053+ "primaryKey": false,
3054+ "notNull": false
3055+ },
3056+ "region": {
3057+ "name": "region",
3058+ "type": "text",
3059+ "primaryKey": false,
3060+ "notNull": false
3061+ },
3062+ "country": {
3063+ "name": "country",
3064+ "type": "text",
3065+ "primaryKey": false,
3066+ "notNull": false
3067+ },
3068+ "material": {
3069+ "name": "material",
3070+ "type": "text",
3071+ "primaryKey": false,
3072+ "notNull": false
3073+ },
3074+ "size": {
3075+ "name": "size",
3076+ "type": "text",
3077+ "primaryKey": false,
3078+ "notNull": false
3079+ },
3080+ "color": {
3081+ "name": "color",
3082+ "type": "text",
3083+ "primaryKey": false,
3084+ "notNull": false
3085+ },
3086+ "rarity": {
3087+ "name": "rarity",
3088+ "type": "text",
3089+ "primaryKey": false,
3090+ "notNull": false
3091+ },
3092+ "production_quantity": {
3093+ "name": "production_quantity",
3094+ "type": "integer",
3095+ "primaryKey": false,
3096+ "notNull": false
3097+ },
3098+ "original_msrp": {
3099+ "name": "original_msrp",
3100+ "type": "numeric(18, 4)",
3101+ "primaryKey": false,
3102+ "notNull": false
3103+ },
3104+ "original_msrp_currency": {
3105+ "name": "original_msrp_currency",
3106+ "type": "text",
3107+ "primaryKey": false,
3108+ "notNull": false
3109+ },
3110+ "release_date": {
3111+ "name": "release_date",
3112+ "type": "text",
3113+ "primaryKey": false,
3114+ "notNull": false
3115+ },
3116+ "description": {
3117+ "name": "description",
3118+ "type": "text",
3119+ "primaryKey": false,
3120+ "notNull": false
3121+ },
3122+ "hero_image_url": {
3123+ "name": "hero_image_url",
3124+ "type": "text",
3125+ "primaryKey": false,
3126+ "notNull": false
3127+ },
3128+ "identifiers": {
3129+ "name": "identifiers",
3130+ "type": "jsonb",
3131+ "primaryKey": false,
3132+ "notNull": true,
3133+ "default": "'{}'::jsonb"
3134+ },
3135+ "metadata": {
3136+ "name": "metadata",
3137+ "type": "jsonb",
3138+ "primaryKey": false,
3139+ "notNull": true,
3140+ "default": "'{}'::jsonb"
3141+ },
3142+ "merged_from": {
3143+ "name": "merged_from",
3144+ "type": "text[]",
3145+ "primaryKey": false,
3146+ "notNull": true,
3147+ "default": "'{}'::text[]"
3148+ },
3149+ "data_quality": {
3150+ "name": "data_quality",
3151+ "type": "real",
3152+ "primaryKey": false,
3153+ "notNull": true,
3154+ "default": 0
3155+ },
3156+ "verified": {
3157+ "name": "verified",
3158+ "type": "boolean",
3159+ "primaryKey": false,
3160+ "notNull": true,
3161+ "default": false
3162+ },
3163+ "search": {
3164+ "name": "search",
3165+ "type": "tsvector",
3166+ "primaryKey": false,
3167+ "notNull": false,
3168+ "generated": {
3169+ "as": "setweight(to_tsvector('simple', coalesce(name, '')), 'A') || setweight(to_tsvector('simple', coalesce(set_name, '') || ' ' || coalesce(number, '') || ' ' || coalesce(variant, '') || ' ' || coalesce(edition, '')), 'B') || setweight(to_tsvector('simple', coalesce(brand, '') || ' ' || coalesce(franchise, '') || ' ' || coalesce(reference, '') || ' ' || coalesce(model, '') || ' ' || coalesce(year::text, '') || ' ' || coalesce(category_slug, '')), 'C')",
3170+ "type": "stored"
3171+ }
3172+ },
3173+ "created_at": {
3174+ "name": "created_at",
3175+ "type": "timestamp with time zone",
3176+ "primaryKey": false,
3177+ "notNull": true,
3178+ "default": "now()"
3179+ },
3180+ "updated_at": {
3181+ "name": "updated_at",
3182+ "type": "timestamp with time zone",
3183+ "primaryKey": false,
3184+ "notNull": true,
3185+ "default": "now()"
3186+ }
3187+ },
3188+ "indexes": {
3189+ "assets_canonical_key_uq": {
3190+ "name": "assets_canonical_key_uq",
3191+ "columns": [
3192+ {
3193+ "expression": "canonical_key",
3194+ "isExpression": false,
3195+ "asc": true,
3196+ "nulls": "last"
3197+ }
3198+ ],
3199+ "isUnique": true,
3200+ "concurrently": false,
3201+ "method": "btree",
3202+ "with": {}
3203+ },
3204+ "assets_slug_uq": {
3205+ "name": "assets_slug_uq",
3206+ "columns": [
3207+ {
3208+ "expression": "slug",
3209+ "isExpression": false,
3210+ "asc": true,
3211+ "nulls": "last"
3212+ }
3213+ ],
3214+ "isUnique": true,
3215+ "concurrently": false,
3216+ "method": "btree",
3217+ "with": {}
3218+ },
3219+ "assets_category_idx": {
3220+ "name": "assets_category_idx",
3221+ "columns": [
3222+ {
3223+ "expression": "category_slug",
3224+ "isExpression": false,
3225+ "asc": true,
3226+ "nulls": "last"
3227+ }
3228+ ],
3229+ "isUnique": false,
3230+ "concurrently": false,
3231+ "method": "btree",
3232+ "with": {}
3233+ },
3234+ "assets_family_idx": {
3235+ "name": "assets_family_idx",
3236+ "columns": [
3237+ {
3238+ "expression": "family_slug",
3239+ "isExpression": false,
3240+ "asc": true,
3241+ "nulls": "last"
3242+ }
3243+ ],
3244+ "isUnique": false,
3245+ "concurrently": false,
3246+ "method": "btree",
3247+ "with": {}
3248+ },
3249+ "assets_set_idx": {
3250+ "name": "assets_set_idx",
3251+ "columns": [
3252+ {
3253+ "expression": "set_slug",
3254+ "isExpression": false,
3255+ "asc": true,
3256+ "nulls": "last"
3257+ }
3258+ ],
3259+ "isUnique": false,
3260+ "concurrently": false,
3261+ "method": "btree",
3262+ "with": {}
3263+ },
3264+ "assets_search_gin": {
3265+ "name": "assets_search_gin",
3266+ "columns": [
3267+ {
3268+ "expression": "search",
3269+ "isExpression": false,
3270+ "asc": true,
3271+ "nulls": "last"
3272+ }
3273+ ],
3274+ "isUnique": false,
3275+ "concurrently": false,
3276+ "method": "gin",
3277+ "with": {}
3278+ },
3279+ "assets_title_trgm": {
3280+ "name": "assets_title_trgm",
3281+ "columns": [
3282+ {
3283+ "expression": "\"title\" gin_trgm_ops",
3284+ "asc": true,
3285+ "isExpression": true,
3286+ "nulls": "last"
3287+ }
3288+ ],
3289+ "isUnique": false,
3290+ "concurrently": false,
3291+ "method": "gin",
3292+ "with": {}
3293+ },
3294+ "assets_identifiers_gin": {
3295+ "name": "assets_identifiers_gin",
3296+ "columns": [
3297+ {
3298+ "expression": "identifiers",
3299+ "isExpression": false,
3300+ "asc": true,
3301+ "nulls": "last"
3302+ }
3303+ ],
3304+ "isUnique": false,
3305+ "concurrently": false,
3306+ "method": "gin",
3307+ "with": {}
3308+ }
3309+ },
3310+ "foreignKeys": {},
3311+ "compositePrimaryKeys": {},
3312+ "uniqueConstraints": {},
3313+ "policies": {},
3314+ "checkConstraints": {},
3315+ "isRLSEnabled": false
3316+ },
3317+ "public.grade_premiums": {
3318+ "name": "grade_premiums",
3319+ "schema": "",
3320+ "columns": {
3321+ "id": {
3322+ "name": "id",
3323+ "type": "text",
3324+ "primaryKey": true,
3325+ "notNull": true
3326+ },
3327+ "category_slug": {
3328+ "name": "category_slug",
3329+ "type": "text",
3330+ "primaryKey": false,
3331+ "notNull": true
3332+ },
3333+ "grader": {
3334+ "name": "grader",
3335+ "type": "text",
3336+ "primaryKey": false,
3337+ "notNull": true
3338+ },
3339+ "grade": {
3340+ "name": "grade",
3341+ "type": "text",
3342+ "primaryKey": false,
3343+ "notNull": true
3344+ },
3345+ "market_multiplier": {
3346+ "name": "market_multiplier",
3347+ "type": "real",
3348+ "primaryKey": false,
3349+ "notNull": true
3350+ },
3351+ "sample_size": {
3352+ "name": "sample_size",
3353+ "type": "integer",
3354+ "primaryKey": false,
3355+ "notNull": true
3356+ },
3357+ "computed_at": {
3358+ "name": "computed_at",
3359+ "type": "timestamp with time zone",
3360+ "primaryKey": false,
3361+ "notNull": true
3362+ }
3363+ },
3364+ "indexes": {
3365+ "grade_premiums_uq": {
3366+ "name": "grade_premiums_uq",
3367+ "columns": [
3368+ {
3369+ "expression": "category_slug",
3370+ "isExpression": false,
3371+ "asc": true,
3372+ "nulls": "last"
3373+ },
3374+ {
3375+ "expression": "grader",
3376+ "isExpression": false,
3377+ "asc": true,
3378+ "nulls": "last"
3379+ },
3380+ {
3381+ "expression": "grade",
3382+ "isExpression": false,
3383+ "asc": true,
3384+ "nulls": "last"
3385+ }
3386+ ],
3387+ "isUnique": true,
3388+ "concurrently": false,
3389+ "method": "btree",
3390+ "with": {}
3391+ }
3392+ },
3393+ "foreignKeys": {},
3394+ "compositePrimaryKeys": {},
3395+ "uniqueConstraints": {},
3396+ "policies": {},
3397+ "checkConstraints": {},
3398+ "isRLSEnabled": false
3399+ },
3400+ "public.images": {
3401+ "name": "images",
3402+ "schema": "",
3403+ "columns": {
3404+ "id": {
3405+ "name": "id",
3406+ "type": "text",
3407+ "primaryKey": true,
3408+ "notNull": true
3409+ },
3410+ "asset_id": {
3411+ "name": "asset_id",
3412+ "type": "text",
3413+ "primaryKey": false,
3414+ "notNull": false
3415+ },
3416+ "listing_id": {
3417+ "name": "listing_id",
3418+ "type": "text",
3419+ "primaryKey": false,
3420+ "notNull": false
3421+ },
3422+ "sale_id": {
3423+ "name": "sale_id",
3424+ "type": "text",
3425+ "primaryKey": false,
3426+ "notNull": false
3427+ },
3428+ "source_id": {
3429+ "name": "source_id",
3430+ "type": "text",
3431+ "primaryKey": false,
3432+ "notNull": false
3433+ },
3434+ "url": {
3435+ "name": "url",
3436+ "type": "text",
3437+ "primaryKey": false,
3438+ "notNull": true
3439+ },
3440+ "role": {
3441+ "name": "role",
3442+ "type": "text",
3443+ "primaryKey": false,
3444+ "notNull": true,
3445+ "default": "'gallery'"
3446+ },
3447+ "width": {
3448+ "name": "width",
3449+ "type": "integer",
3450+ "primaryKey": false,
3451+ "notNull": false
3452+ },
3453+ "height": {
3454+ "name": "height",
3455+ "type": "integer",
3456+ "primaryKey": false,
3457+ "notNull": false
3458+ },
3459+ "phash": {
3460+ "name": "phash",
3461+ "type": "text",
3462+ "primaryKey": false,
3463+ "notNull": false
3464+ },
3465+ "embedding": {
3466+ "name": "embedding",
3467+ "type": "vector(512)",
3468+ "primaryKey": false,
3469+ "notNull": false
3470+ },
3471+ "attribution": {
3472+ "name": "attribution",
3473+ "type": "text",
3474+ "primaryKey": false,
3475+ "notNull": false
3476+ },
3477+ "status": {
3478+ "name": "status",
3479+ "type": "text",
3480+ "primaryKey": false,
3481+ "notNull": true,
3482+ "default": "'unchecked'"
3483+ },
3484+ "checked_at": {
3485+ "name": "checked_at",
3486+ "type": "timestamp with time zone",
3487+ "primaryKey": false,
3488+ "notNull": false
3489+ },
3490+ "bytes": {
3491+ "name": "bytes",
3492+ "type": "integer",
3493+ "primaryKey": false,
3494+ "notNull": false
3495+ },
3496+ "content_type": {
3497+ "name": "content_type",
3498+ "type": "text",
3499+ "primaryKey": false,
3500+ "notNull": false
3501+ },
3502+ "cache_key": {
3503+ "name": "cache_key",
3504+ "type": "text",
3505+ "primaryKey": false,
3506+ "notNull": false
3507+ },
3508+ "error": {
3509+ "name": "error",
3510+ "type": "text",
3511+ "primaryKey": false,
3512+ "notNull": false
3513+ },
3514+ "created_at": {
3515+ "name": "created_at",
3516+ "type": "timestamp with time zone",
3517+ "primaryKey": false,
3518+ "notNull": true,
3519+ "default": "now()"
3520+ }
3521+ },
3522+ "indexes": {
3523+ "images_asset_idx": {
3524+ "name": "images_asset_idx",
3525+ "columns": [
3526+ {
3527+ "expression": "asset_id",
3528+ "isExpression": false,
3529+ "asc": true,
3530+ "nulls": "last"
3531+ }
3532+ ],
3533+ "isUnique": false,
3534+ "concurrently": false,
3535+ "method": "btree",
3536+ "with": {}
3537+ },
3538+ "images_phash_idx": {
3539+ "name": "images_phash_idx",
3540+ "columns": [
3541+ {
3542+ "expression": "phash",
3543+ "isExpression": false,
3544+ "asc": true,
3545+ "nulls": "last"
3546+ }
3547+ ],
3548+ "isUnique": false,
3549+ "concurrently": false,
3550+ "method": "btree",
3551+ "with": {}
3552+ },
3553+ "images_url_uq": {
3554+ "name": "images_url_uq",
3555+ "columns": [
3556+ {
3557+ "expression": "url",
3558+ "isExpression": false,
3559+ "asc": true,
3560+ "nulls": "last"
3561+ }
3562+ ],
3563+ "isUnique": true,
3564+ "concurrently": false,
3565+ "method": "btree",
3566+ "with": {}
3567+ },
3568+ "images_cache_key_idx": {
3569+ "name": "images_cache_key_idx",
3570+ "columns": [
3571+ {
3572+ "expression": "cache_key",
3573+ "isExpression": false,
3574+ "asc": true,
3575+ "nulls": "last"
3576+ }
3577+ ],
3578+ "isUnique": false,
3579+ "concurrently": false,
3580+ "method": "btree",
3581+ "with": {}
3582+ },
3583+ "images_status_idx": {
3584+ "name": "images_status_idx",
3585+ "columns": [
3586+ {
3587+ "expression": "status",
3588+ "isExpression": false,
3589+ "asc": true,
3590+ "nulls": "last"
3591+ },
3592+ {
3593+ "expression": "checked_at",
3594+ "isExpression": false,
3595+ "asc": true,
3596+ "nulls": "last"
3597+ }
3598+ ],
3599+ "isUnique": false,
3600+ "concurrently": false,
3601+ "method": "btree",
3602+ "with": {}
3603+ }
3604+ },
3605+ "foreignKeys": {},
3606+ "compositePrimaryKeys": {},
3607+ "uniqueConstraints": {},
3608+ "policies": {},
3609+ "checkConstraints": {},
3610+ "isRLSEnabled": false
3611+ },
3612+ "public.population_reports": {
3613+ "name": "population_reports",
3614+ "schema": "",
3615+ "columns": {
3616+ "id": {
3617+ "name": "id",
3618+ "type": "text",
3619+ "primaryKey": true,
3620+ "notNull": true
3621+ },
3622+ "asset_id": {
3623+ "name": "asset_id",
3624+ "type": "text",
3625+ "primaryKey": false,
3626+ "notNull": true
3627+ },
3628+ "grader": {
3629+ "name": "grader",
3630+ "type": "text",
3631+ "primaryKey": false,
3632+ "notNull": true
3633+ },
3634+ "source_id": {
3635+ "name": "source_id",
3636+ "type": "text",
3637+ "primaryKey": false,
3638+ "notNull": true
3639+ },
3640+ "source_url": {
3641+ "name": "source_url",
3642+ "type": "text",
3643+ "primaryKey": false,
3644+ "notNull": false
3645+ },
3646+ "report_date": {
3647+ "name": "report_date",
3648+ "type": "text",
3649+ "primaryKey": false,
3650+ "notNull": true
3651+ },
3652+ "total": {
3653+ "name": "total",
3654+ "type": "integer",
3655+ "primaryKey": false,
3656+ "notNull": true
3657+ },
3658+ "by_grade": {
3659+ "name": "by_grade",
3660+ "type": "jsonb",
3661+ "primaryKey": false,
3662+ "notNull": true
3663+ },
3664+ "created_at": {
3665+ "name": "created_at",
3666+ "type": "timestamp with time zone",
3667+ "primaryKey": false,
3668+ "notNull": true,
3669+ "default": "now()"
3670+ }
3671+ },
3672+ "indexes": {
3673+ "population_reports_uq": {
3674+ "name": "population_reports_uq",
3675+ "columns": [
3676+ {
3677+ "expression": "asset_id",
3678+ "isExpression": false,
3679+ "asc": true,
3680+ "nulls": "last"
3681+ },
3682+ {
3683+ "expression": "grader",
3684+ "isExpression": false,
3685+ "asc": true,
3686+ "nulls": "last"
3687+ },
3688+ {
3689+ "expression": "report_date",
3690+ "isExpression": false,
3691+ "asc": true,
3692+ "nulls": "last"
3693+ }
3694+ ],
3695+ "isUnique": true,
3696+ "concurrently": false,
3697+ "method": "btree",
3698+ "with": {}
3699+ }
3700+ },
3701+ "foreignKeys": {},
3702+ "compositePrimaryKeys": {},
3703+ "uniqueConstraints": {},
3704+ "policies": {},
3705+ "checkConstraints": {},
3706+ "isRLSEnabled": false
3707+ },
3708+ "public.variant_stats": {
3709+ "name": "variant_stats",
3710+ "schema": "",
3711+ "columns": {
3712+ "variant_id": {
3713+ "name": "variant_id",
3714+ "type": "text",
3715+ "primaryKey": true,
3716+ "notNull": true
3717+ },
3718+ "asset_id": {
3719+ "name": "asset_id",
3720+ "type": "text",
3721+ "primaryKey": false,
3722+ "notNull": true
3723+ },
3724+ "riv_usd": {
3725+ "name": "riv_usd",
3726+ "type": "numeric(18, 4)",
3727+ "primaryKey": false,
3728+ "notNull": false
3729+ },
3730+ "riv_low_usd": {
3731+ "name": "riv_low_usd",
3732+ "type": "numeric(18, 4)",
3733+ "primaryKey": false,
3734+ "notNull": false
3735+ },
3736+ "riv_high_usd": {
3737+ "name": "riv_high_usd",
3738+ "type": "numeric(18, 4)",
3739+ "primaryKey": false,
3740+ "notNull": false
3741+ },
3742+ "riv_confidence": {
3743+ "name": "riv_confidence",
3744+ "type": "numeric(8, 6)",
3745+ "primaryKey": false,
3746+ "notNull": false
3747+ },
3748+ "riv_sample_size": {
3749+ "name": "riv_sample_size",
3750+ "type": "integer",
3751+ "primaryKey": false,
3752+ "notNull": true,
3753+ "default": 0
3754+ },
3755+ "latest_sale_usd": {
3756+ "name": "latest_sale_usd",
3757+ "type": "numeric(18, 4)",
3758+ "primaryKey": false,
3759+ "notNull": false
3760+ },
3761+ "latest_sale_at": {
3762+ "name": "latest_sale_at",
3763+ "type": "timestamp with time zone",
3764+ "primaryKey": false,
3765+ "notNull": false
3766+ },
3767+ "change_30d": {
3768+ "name": "change_30d",
3769+ "type": "numeric(8, 6)",
3770+ "primaryKey": false,
3771+ "notNull": false
3772+ },
3773+ "change_1y": {
3774+ "name": "change_1y",
3775+ "type": "numeric(8, 6)",
3776+ "primaryKey": false,
3777+ "notNull": false
3778+ },
3779+ "sales_count": {
3780+ "name": "sales_count",
3781+ "type": "integer",
3782+ "primaryKey": false,
3783+ "notNull": true,
3784+ "default": 0
3785+ },
3786+ "sales_30d": {
3787+ "name": "sales_30d",
3788+ "type": "integer",
3789+ "primaryKey": false,
3790+ "notNull": true,
3791+ "default": 0
3792+ },
3793+ "active_listings": {
3794+ "name": "active_listings",
3795+ "type": "integer",
3796+ "primaryKey": false,
3797+ "notNull": true,
3798+ "default": 0
3799+ },
3800+ "min_ask_usd": {
3801+ "name": "min_ask_usd",
3802+ "type": "numeric(18, 4)",
3803+ "primaryKey": false,
3804+ "notNull": false
3805+ },
3806+ "liquidity_score": {
3807+ "name": "liquidity_score",
3808+ "type": "real",
3809+ "primaryKey": false,
3810+ "notNull": false
3811+ },
3812+ "updated_at": {
3813+ "name": "updated_at",
3814+ "type": "timestamp with time zone",
3815+ "primaryKey": false,
3816+ "notNull": true,
3817+ "default": "now()"
3818+ }
3819+ },
3820+ "indexes": {
3821+ "variant_stats_asset_idx": {
3822+ "name": "variant_stats_asset_idx",
3823+ "columns": [
3824+ {
3825+ "expression": "asset_id",
3826+ "isExpression": false,
3827+ "asc": true,
3828+ "nulls": "last"
3829+ }
3830+ ],
3831+ "isUnique": false,
3832+ "concurrently": false,
3833+ "method": "btree",
3834+ "with": {}
3835+ }
3836+ },
3837+ "foreignKeys": {},
3838+ "compositePrimaryKeys": {},
3839+ "uniqueConstraints": {},
3840+ "policies": {},
3841+ "checkConstraints": {},
3842+ "isRLSEnabled": false
3843+ },
3844+ "public.auction_lots": {
3845+ "name": "auction_lots",
3846+ "schema": "",
3847+ "columns": {
3848+ "id": {
3849+ "name": "id",
3850+ "type": "text",
3851+ "primaryKey": true,
3852+ "notNull": true
3853+ },
3854+ "auction_id": {
3855+ "name": "auction_id",
3856+ "type": "text",
3857+ "primaryKey": false,
3858+ "notNull": true
3859+ },
3860+ "asset_id": {
3861+ "name": "asset_id",
3862+ "type": "text",
3863+ "primaryKey": false,
3864+ "notNull": false
3865+ },
3866+ "variant_id": {
3867+ "name": "variant_id",
3868+ "type": "text",
3869+ "primaryKey": false,
3870+ "notNull": false
3871+ },
3872+ "source_id": {
3873+ "name": "source_id",
3874+ "type": "text",
3875+ "primaryKey": false,
3876+ "notNull": true
3877+ },
3878+ "lot_number": {
3879+ "name": "lot_number",
3880+ "type": "text",
3881+ "primaryKey": false,
3882+ "notNull": false
3883+ },
3884+ "title": {
3885+ "name": "title",
3886+ "type": "text",
3887+ "primaryKey": false,
3888+ "notNull": true
3889+ },
3890+ "url": {
3891+ "name": "url",
3892+ "type": "text",
3893+ "primaryKey": false,
3894+ "notNull": true
3895+ },
3896+ "estimate_low": {
3897+ "name": "estimate_low",
3898+ "type": "numeric(18, 4)",
3899+ "primaryKey": false,
3900+ "notNull": false
3901+ },
3902+ "estimate_high": {
3903+ "name": "estimate_high",
3904+ "type": "numeric(18, 4)",
3905+ "primaryKey": false,
3906+ "notNull": false
3907+ },
3908+ "current_bid": {
3909+ "name": "current_bid",
3910+ "type": "numeric(18, 4)",
3911+ "primaryKey": false,
3912+ "notNull": false
3913+ },
3914+ "hammer_price": {
3915+ "name": "hammer_price",
3916+ "type": "numeric(18, 4)",
3917+ "primaryKey": false,
3918+ "notNull": false
3919+ },
3920+ "currency": {
3921+ "name": "currency",
3922+ "type": "text",
3923+ "primaryKey": false,
3924+ "notNull": false
3925+ },
3926+ "bid_count": {
3927+ "name": "bid_count",
3928+ "type": "integer",
3929+ "primaryKey": false,
3930+ "notNull": false
3931+ },
3932+ "estimate_low_usd": {
3933+ "name": "estimate_low_usd",
3934+ "type": "numeric(18, 4)",
3935+ "primaryKey": false,
3936+ "notNull": false
3937+ },
3938+ "estimate_high_usd": {
3939+ "name": "estimate_high_usd",
3940+ "type": "numeric(18, 4)",
3941+ "primaryKey": false,
3942+ "notNull": false
3943+ },
3944+ "current_bid_usd": {
3945+ "name": "current_bid_usd",
3946+ "type": "numeric(18, 4)",
3947+ "primaryKey": false,
3948+ "notNull": false
3949+ },
3950+ "hammer_price_usd": {
3951+ "name": "hammer_price_usd",
3952+ "type": "numeric(18, 4)",
3953+ "primaryKey": false,
3954+ "notNull": false
3955+ },
3956+ "fx_rate": {
3957+ "name": "fx_rate",
3958+ "type": "real",
3959+ "primaryKey": false,
3960+ "notNull": false
3961+ },
3962+ "fx_date": {
3963+ "name": "fx_date",
3964+ "type": "date",
3965+ "primaryKey": false,
3966+ "notNull": false
3967+ },
3968+ "buyer_premium_rate": {
3969+ "name": "buyer_premium_rate",
3970+ "type": "real",
3971+ "primaryKey": false,
3972+ "notNull": false
3973+ },
3974+ "fee_basis": {
3975+ "name": "fee_basis",
3976+ "type": "text",
3977+ "primaryKey": false,
3978+ "notNull": false
3979+ },
3980+ "all_in_bid_usd": {
3981+ "name": "all_in_bid_usd",
3982+ "type": "numeric(18, 4)",
3983+ "primaryKey": false,
3984+ "notNull": false
3985+ },
3986+ "all_in_estimate_low_usd": {
3987+ "name": "all_in_estimate_low_usd",
3988+ "type": "numeric(18, 4)",
3989+ "primaryKey": false,
3990+ "notNull": false
3991+ },
3992+ "all_in_estimate_high_usd": {
3993+ "name": "all_in_estimate_high_usd",
3994+ "type": "numeric(18, 4)",
3995+ "primaryKey": false,
3996+ "notNull": false
3997+ },
3998+ "riv_usd_at_assessment": {
3999+ "name": "riv_usd_at_assessment",
4000+ "type": "numeric(18, 4)",
4001+ "primaryKey": false,
4002+ "notNull": false
4003+ },
4004+ "bid_vs_riv": {
4005+ "name": "bid_vs_riv",
4006+ "type": "real",
4007+ "primaryKey": false,
4008+ "notNull": false
4009+ },
4010+ "estimate_vs_riv": {
4011+ "name": "estimate_vs_riv",
4012+ "type": "real",
4013+ "primaryKey": false,
4014+ "notNull": false
4015+ },
4016+ "assessment_verdict": {
4017+ "name": "assessment_verdict",
4018+ "type": "text",
4019+ "primaryKey": false,
4020+ "notNull": false
4021+ },
4022+ "assessed_at": {
4023+ "name": "assessed_at",
4024+ "type": "timestamp with time zone",
4025+ "primaryKey": false,
4026+ "notNull": false
4027+ },
4028+ "starts_at": {
4029+ "name": "starts_at",
4030+ "type": "timestamp with time zone",
4031+ "primaryKey": false,
4032+ "notNull": false
4033+ },
4034+ "ends_at": {
4035+ "name": "ends_at",
4036+ "type": "timestamp with time zone",
4037+ "primaryKey": false,
4038+ "notNull": false
4039+ },
4040+ "status": {
4041+ "name": "status",
4042+ "type": "text",
4043+ "primaryKey": false,
4044+ "notNull": true,
4045+ "default": "'upcoming'"
4046+ },
4047+ "image_urls": {
4048+ "name": "image_urls",
4049+ "type": "jsonb",
4050+ "primaryKey": false,
4051+ "notNull": true,
4052+ "default": "'[]'::jsonb"
4053+ },
4054+ "grader": {
4055+ "name": "grader",
4056+ "type": "text",
4057+ "primaryKey": false,
4058+ "notNull": false
4059+ },
4060+ "grade": {
4061+ "name": "grade",
4062+ "type": "text",
4063+ "primaryKey": false,
4064+ "notNull": false
4065+ },
4066+ "created_at": {
4067+ "name": "created_at",
4068+ "type": "timestamp with time zone",
4069+ "primaryKey": false,
4070+ "notNull": true,
4071+ "default": "now()"
4072+ },
4073+ "updated_at": {
4074+ "name": "updated_at",
4075+ "type": "timestamp with time zone",
4076+ "primaryKey": false,
4077+ "notNull": true,
4078+ "default": "now()"
4079+ }
4080+ },
4081+ "indexes": {
4082+ "auction_lots_url_uq": {
4083+ "name": "auction_lots_url_uq",
4084+ "columns": [
4085+ {
4086+ "expression": "url",
4087+ "isExpression": false,
4088+ "asc": true,
4089+ "nulls": "last"
4090+ }
4091+ ],
4092+ "isUnique": true,
4093+ "concurrently": false,
4094+ "method": "btree",
4095+ "with": {}
4096+ },
4097+ "auction_lots_auction_idx": {
4098+ "name": "auction_lots_auction_idx",
4099+ "columns": [
4100+ {
4101+ "expression": "auction_id",
4102+ "isExpression": false,
4103+ "asc": true,
4104+ "nulls": "last"
4105+ }
4106+ ],
4107+ "isUnique": false,
4108+ "concurrently": false,
4109+ "method": "btree",
4110+ "with": {}
4111+ },
4112+ "auction_lots_asset_idx": {
4113+ "name": "auction_lots_asset_idx",
4114+ "columns": [
4115+ {
4116+ "expression": "asset_id",
4117+ "isExpression": false,
4118+ "asc": true,
4119+ "nulls": "last"
4120+ }
4121+ ],
4122+ "isUnique": false,
4123+ "concurrently": false,
4124+ "method": "btree",
4125+ "with": {}
4126+ },
4127+ "auction_lots_ends_idx": {
4128+ "name": "auction_lots_ends_idx",
4129+ "columns": [
4130+ {
4131+ "expression": "ends_at",
4132+ "isExpression": false,
4133+ "asc": true,
4134+ "nulls": "last"
4135+ }
4136+ ],
4137+ "isUnique": false,
4138+ "concurrently": false,
4139+ "method": "btree",
4140+ "with": {}
4141+ },
4142+ "auction_lots_status_ends_idx": {
4143+ "name": "auction_lots_status_ends_idx",
4144+ "columns": [
4145+ {
4146+ "expression": "status",
4147+ "isExpression": false,
4148+ "asc": true,
4149+ "nulls": "last"
4150+ },
4151+ {
4152+ "expression": "ends_at",
4153+ "isExpression": false,
4154+ "asc": true,
4155+ "nulls": "last"
4156+ }
4157+ ],
4158+ "isUnique": false,
4159+ "concurrently": false,
4160+ "method": "btree",
4161+ "with": {}
4162+ },
4163+ "auction_lots_bid_vs_riv_idx": {
4164+ "name": "auction_lots_bid_vs_riv_idx",
4165+ "columns": [
4166+ {
4167+ "expression": "bid_vs_riv",
4168+ "isExpression": false,
4169+ "asc": true,
4170+ "nulls": "last"
4171+ }
4172+ ],
4173+ "isUnique": false,
4174+ "where": "bid_vs_riv is not null and status in ('live','upcoming')",
4175+ "concurrently": false,
4176+ "method": "btree",
4177+ "with": {}
4178+ }
4179+ },
4180+ "foreignKeys": {},
4181+ "compositePrimaryKeys": {},
4182+ "uniqueConstraints": {},
4183+ "policies": {},
4184+ "checkConstraints": {},
4185+ "isRLSEnabled": false
4186+ },
4187+ "public.auctions": {
4188+ "name": "auctions",
4189+ "schema": "",
4190+ "columns": {
4191+ "id": {
4192+ "name": "id",
4193+ "type": "text",
4194+ "primaryKey": true,
4195+ "notNull": true
4196+ },
4197+ "source_id": {
4198+ "name": "source_id",
4199+ "type": "text",
4200+ "primaryKey": false,
4201+ "notNull": true
4202+ },
4203+ "auction_house": {
4204+ "name": "auction_house",
4205+ "type": "text",
4206+ "primaryKey": false,
4207+ "notNull": true
4208+ },
4209+ "name": {
4210+ "name": "name",
4211+ "type": "text",
4212+ "primaryKey": false,
4213+ "notNull": true
4214+ },
4215+ "url": {
4216+ "name": "url",
4217+ "type": "text",
4218+ "primaryKey": false,
4219+ "notNull": true
4220+ },
4221+ "starts_at": {
4222+ "name": "starts_at",
4223+ "type": "timestamp with time zone",
4224+ "primaryKey": false,
4225+ "notNull": false
4226+ },
4227+ "ends_at": {
4228+ "name": "ends_at",
4229+ "type": "timestamp with time zone",
4230+ "primaryKey": false,
4231+ "notNull": false
4232+ },
4233+ "location": {
4234+ "name": "location",
4235+ "type": "text",
4236+ "primaryKey": false,
4237+ "notNull": false
4238+ },
4239+ "category_slugs": {
4240+ "name": "category_slugs",
4241+ "type": "text[]",
4242+ "primaryKey": false,
4243+ "notNull": true,
4244+ "default": "'{}'::text[]"
4245+ },
4246+ "lot_count": {
4247+ "name": "lot_count",
4248+ "type": "integer",
4249+ "primaryKey": false,
4250+ "notNull": false
4251+ },
4252+ "status": {
4253+ "name": "status",
4254+ "type": "text",
4255+ "primaryKey": false,
4256+ "notNull": true,
4257+ "default": "'upcoming'"
4258+ },
4259+ "currency": {
4260+ "name": "currency",
4261+ "type": "text",
4262+ "primaryKey": false,
4263+ "notNull": false
4264+ },
4265+ "created_at": {
4266+ "name": "created_at",
4267+ "type": "timestamp with time zone",
4268+ "primaryKey": false,
4269+ "notNull": true,
4270+ "default": "now()"
4271+ },
4272+ "updated_at": {
4273+ "name": "updated_at",
4274+ "type": "timestamp with time zone",
4275+ "primaryKey": false,
4276+ "notNull": true,
4277+ "default": "now()"
4278+ }
4279+ },
4280+ "indexes": {
4281+ "auctions_url_uq": {
4282+ "name": "auctions_url_uq",
4283+ "columns": [
4284+ {
4285+ "expression": "url",
4286+ "isExpression": false,
4287+ "asc": true,
4288+ "nulls": "last"
4289+ }
4290+ ],
4291+ "isUnique": true,
4292+ "concurrently": false,
4293+ "method": "btree",
4294+ "with": {}
4295+ },
4296+ "auctions_ends_idx": {
4297+ "name": "auctions_ends_idx",
4298+ "columns": [
4299+ {
4300+ "expression": "ends_at",
4301+ "isExpression": false,
4302+ "asc": true,
4303+ "nulls": "last"
4304+ }
4305+ ],
4306+ "isUnique": false,
4307+ "concurrently": false,
4308+ "method": "btree",
4309+ "with": {}
4310+ }
4311+ },
4312+ "foreignKeys": {},
4313+ "compositePrimaryKeys": {},
4314+ "uniqueConstraints": {},
4315+ "policies": {},
4316+ "checkConstraints": {},
4317+ "isRLSEnabled": false
4318+ },
4319+ "public.cross_listing_groups": {
4320+ "name": "cross_listing_groups",
4321+ "schema": "",
4322+ "columns": {
4323+ "id": {
4324+ "name": "id",
4325+ "type": "text",
4326+ "primaryKey": true,
4327+ "notNull": true
4328+ },
4329+ "asset_id": {
4330+ "name": "asset_id",
4331+ "type": "text",
4332+ "primaryKey": false,
4333+ "notNull": false
4334+ },
4335+ "signals": {
4336+ "name": "signals",
4337+ "type": "jsonb",
4338+ "primaryKey": false,
4339+ "notNull": true,
4340+ "default": "'{}'::jsonb"
4341+ },
4342+ "created_at": {
4343+ "name": "created_at",
4344+ "type": "timestamp with time zone",
4345+ "primaryKey": false,
4346+ "notNull": true,
4347+ "default": "now()"
4348+ }
4349+ },
4350+ "indexes": {},
4351+ "foreignKeys": {},
4352+ "compositePrimaryKeys": {},
4353+ "uniqueConstraints": {},
4354+ "policies": {},
4355+ "checkConstraints": {},
4356+ "isRLSEnabled": false
4357+ },
4358+ "public.fx_rates": {
4359+ "name": "fx_rates",
4360+ "schema": "",
4361+ "columns": {
4362+ "date": {
4363+ "name": "date",
4364+ "type": "date",
4365+ "primaryKey": false,
4366+ "notNull": true
4367+ },
4368+ "base": {
4369+ "name": "base",
4370+ "type": "text",
4371+ "primaryKey": false,
4372+ "notNull": true
4373+ },
4374+ "quote": {
4375+ "name": "quote",
4376+ "type": "text",
4377+ "primaryKey": false,
4378+ "notNull": true
4379+ },
4380+ "rate": {
4381+ "name": "rate",
4382+ "type": "real",
4383+ "primaryKey": false,
4384+ "notNull": true
4385+ },
4386+ "source": {
4387+ "name": "source",
4388+ "type": "text",
4389+ "primaryKey": false,
4390+ "notNull": true,
4391+ "default": "'ecb'"
4392+ }
4393+ },
4394+ "indexes": {
4395+ "fx_rates_uq": {
4396+ "name": "fx_rates_uq",
4397+ "columns": [
4398+ {
4399+ "expression": "date",
4400+ "isExpression": false,
4401+ "asc": true,
4402+ "nulls": "last"
4403+ },
4404+ {
4405+ "expression": "base",
4406+ "isExpression": false,
4407+ "asc": true,
4408+ "nulls": "last"
4409+ },
4410+ {
4411+ "expression": "quote",
4412+ "isExpression": false,
4413+ "asc": true,
4414+ "nulls": "last"
4415+ }
4416+ ],
4417+ "isUnique": true,
4418+ "concurrently": false,
4419+ "method": "btree",
4420+ "with": {}
4421+ }
4422+ },
4423+ "foreignKeys": {},
4424+ "compositePrimaryKeys": {},
4425+ "uniqueConstraints": {},
4426+ "policies": {},
4427+ "checkConstraints": {},
4428+ "isRLSEnabled": false
4429+ },
4430+ "public.listing_events": {
4431+ "name": "listing_events",
4432+ "schema": "",
4433+ "columns": {
4434+ "id": {
4435+ "name": "id",
4436+ "type": "text",
4437+ "primaryKey": true,
4438+ "notNull": true
4439+ },
4440+ "listing_id": {
4441+ "name": "listing_id",
4442+ "type": "text",
4443+ "primaryKey": false,
4444+ "notNull": true
4445+ },
4446+ "event_type": {
4447+ "name": "event_type",
4448+ "type": "text",
4449+ "primaryKey": false,
4450+ "notNull": true
4451+ },
4452+ "old_price": {
4453+ "name": "old_price",
4454+ "type": "numeric(18, 4)",
4455+ "primaryKey": false,
4456+ "notNull": false
4457+ },
4458+ "new_price": {
4459+ "name": "new_price",
4460+ "type": "numeric(18, 4)",
4461+ "primaryKey": false,
4462+ "notNull": false
4463+ },
4464+ "currency": {
4465+ "name": "currency",
4466+ "type": "text",
4467+ "primaryKey": false,
4468+ "notNull": false
4469+ },
4470+ "occurred_at": {
4471+ "name": "occurred_at",
4472+ "type": "timestamp with time zone",
4473+ "primaryKey": false,
4474+ "notNull": true
4475+ }
4476+ },
4477+ "indexes": {
4478+ "listing_events_listing_idx": {
4479+ "name": "listing_events_listing_idx",
4480+ "columns": [
4481+ {
4482+ "expression": "listing_id",
4483+ "isExpression": false,
4484+ "asc": true,
4485+ "nulls": "last"
4486+ },
4487+ {
4488+ "expression": "occurred_at",
4489+ "isExpression": false,
4490+ "asc": true,
4491+ "nulls": "last"
4492+ }
4493+ ],
4494+ "isUnique": false,
4495+ "concurrently": false,
4496+ "method": "btree",
4497+ "with": {}
4498+ }
4499+ },
4500+ "foreignKeys": {},
4501+ "compositePrimaryKeys": {},
4502+ "uniqueConstraints": {},
4503+ "policies": {},
4504+ "checkConstraints": {},
4505+ "isRLSEnabled": false
4506+ },
4507+ "public.listings": {
4508+ "name": "listings",
4509+ "schema": "",
4510+ "columns": {
4511+ "id": {
4512+ "name": "id",
4513+ "type": "text",
4514+ "primaryKey": true,
4515+ "notNull": true
4516+ },
4517+ "asset_id": {
4518+ "name": "asset_id",
4519+ "type": "text",
4520+ "primaryKey": false,
4521+ "notNull": true
4522+ },
4523+ "variant_id": {
4524+ "name": "variant_id",
4525+ "type": "text",
4526+ "primaryKey": false,
4527+ "notNull": false
4528+ },
4529+ "source_id": {
4530+ "name": "source_id",
4531+ "type": "text",
4532+ "primaryKey": false,
4533+ "notNull": true
4534+ },
4535+ "connector_id": {
4536+ "name": "connector_id",
4537+ "type": "text",
4538+ "primaryKey": false,
4539+ "notNull": true
4540+ },
4541+ "raw_record_id": {
4542+ "name": "raw_record_id",
4543+ "type": "text",
4544+ "primaryKey": false,
4545+ "notNull": false
4546+ },
4547+ "source_url": {
4548+ "name": "source_url",
4549+ "type": "text",
4550+ "primaryKey": false,
4551+ "notNull": true
4552+ },
4553+ "external_id": {
4554+ "name": "external_id",
4555+ "type": "text",
4556+ "primaryKey": false,
4557+ "notNull": true
4558+ },
4559+ "listing_type": {
4560+ "name": "listing_type",
4561+ "type": "text",
4562+ "primaryKey": false,
4563+ "notNull": true,
4564+ "default": "'unknown'"
4565+ },
4566+ "price": {
4567+ "name": "price",
4568+ "type": "numeric(18, 4)",
4569+ "primaryKey": false,
4570+ "notNull": false
4571+ },
4572+ "currency": {
4573+ "name": "currency",
4574+ "type": "text",
4575+ "primaryKey": false,
4576+ "notNull": false
4577+ },
4578+ "price_usd": {
4579+ "name": "price_usd",
4580+ "type": "numeric(18, 4)",
4581+ "primaryKey": false,
4582+ "notNull": false
4583+ },
4584+ "seller": {
4585+ "name": "seller",
4586+ "type": "text",
4587+ "primaryKey": false,
4588+ "notNull": false
4589+ },
4590+ "seller_reputation": {
4591+ "name": "seller_reputation",
4592+ "type": "text",
4593+ "primaryKey": false,
4594+ "notNull": false
4595+ },
4596+ "location": {
4597+ "name": "location",
4598+ "type": "text",
4599+ "primaryKey": false,
4600+ "notNull": false
4601+ },
4602+ "shipping_cost": {
4603+ "name": "shipping_cost",
4604+ "type": "numeric(18, 4)",
4605+ "primaryKey": false,
4606+ "notNull": false
4607+ },
4608+ "quantity": {
4609+ "name": "quantity",
4610+ "type": "integer",
4611+ "primaryKey": false,
4612+ "notNull": false
4613+ },
4614+ "condition": {
4615+ "name": "condition",
4616+ "type": "text",
4617+ "primaryKey": false,
4618+ "notNull": false
4619+ },
4620+ "grader": {
4621+ "name": "grader",
4622+ "type": "text",
4623+ "primaryKey": false,
4624+ "notNull": false
4625+ },
4626+ "grade": {
4627+ "name": "grade",
4628+ "type": "text",
4629+ "primaryKey": false,
4630+ "notNull": false
4631+ },
4632+ "certification_number": {
4633+ "name": "certification_number",
4634+ "type": "text",
4635+ "primaryKey": false,
4636+ "notNull": false
4637+ },
4638+ "image_urls": {
4639+ "name": "image_urls",
4640+ "type": "jsonb",
4641+ "primaryKey": false,
4642+ "notNull": true,
4643+ "default": "'[]'::jsonb"
4644+ },
4645+ "raw_title": {
4646+ "name": "raw_title",
4647+ "type": "text",
4648+ "primaryKey": false,
4649+ "notNull": true
4650+ },
4651+ "description": {
4652+ "name": "description",
4653+ "type": "text",
4654+ "primaryKey": false,
4655+ "notNull": false
4656+ },
4657+ "listed_at": {
4658+ "name": "listed_at",
4659+ "type": "timestamp with time zone",
4660+ "primaryKey": false,
4661+ "notNull": false
4662+ },
4663+ "ends_at": {
4664+ "name": "ends_at",
4665+ "type": "timestamp with time zone",
4666+ "primaryKey": false,
4667+ "notNull": false
4668+ },
4669+ "availability": {
4670+ "name": "availability",
4671+ "type": "text",
4672+ "primaryKey": false,
4673+ "notNull": true,
4674+ "default": "'available'"
4675+ },
4676+ "bid_count": {
4677+ "name": "bid_count",
4678+ "type": "integer",
4679+ "primaryKey": false,
4680+ "notNull": false
4681+ },
4682+ "first_seen_at": {
4683+ "name": "first_seen_at",
4684+ "type": "timestamp with time zone",
4685+ "primaryKey": false,
4686+ "notNull": true
4687+ },
4688+ "last_seen_at": {
4689+ "name": "last_seen_at",
4690+ "type": "timestamp with time zone",
4691+ "primaryKey": false,
4692+ "notNull": true
4693+ },
4694+ "price_changed_at": {
4695+ "name": "price_changed_at",
4696+ "type": "timestamp with time zone",
4697+ "primaryKey": false,
4698+ "notNull": false
4699+ },
4700+ "cross_listing_group_id": {
4701+ "name": "cross_listing_group_id",
4702+ "type": "text",
4703+ "primaryKey": false,
4704+ "notNull": false
4705+ },
4706+ "confidence": {
4707+ "name": "confidence",
4708+ "type": "numeric(8, 6)",
4709+ "primaryKey": false,
4710+ "notNull": true,
4711+ "default": 0.8
4712+ },
4713+ "data_quality": {
4714+ "name": "data_quality",
4715+ "type": "real",
4716+ "primaryKey": false,
4717+ "notNull": true,
4718+ "default": 0
4719+ },
4720+ "flags": {
4721+ "name": "flags",
4722+ "type": "text[]",
4723+ "primaryKey": false,
4724+ "notNull": true,
4725+ "default": "'{}'::text[]"
4726+ },
4727+ "discount_to_riv": {
4728+ "name": "discount_to_riv",
4729+ "type": "numeric(8, 6)",
4730+ "primaryKey": false,
4731+ "notNull": false
4732+ },
4733+ "created_at": {
4734+ "name": "created_at",
4735+ "type": "timestamp with time zone",
4736+ "primaryKey": false,
4737+ "notNull": true,
4738+ "default": "now()"
4739+ },
4740+ "updated_at": {
4741+ "name": "updated_at",
4742+ "type": "timestamp with time zone",
4743+ "primaryKey": false,
4744+ "notNull": true,
4745+ "default": "now()"
4746+ }
4747+ },
4748+ "indexes": {
4749+ "listings_source_external_uq": {
4750+ "name": "listings_source_external_uq",
4751+ "columns": [
4752+ {
4753+ "expression": "source_id",
4754+ "isExpression": false,
4755+ "asc": true,
4756+ "nulls": "last"
4757+ },
4758+ {
4759+ "expression": "external_id",
4760+ "isExpression": false,
4761+ "asc": true,
4762+ "nulls": "last"
4763+ }
4764+ ],
4765+ "isUnique": true,
4766+ "concurrently": false,
4767+ "method": "btree",
4768+ "with": {}
4769+ },
4770+ "listings_asset_avail_idx": {
4771+ "name": "listings_asset_avail_idx",
4772+ "columns": [
4773+ {
4774+ "expression": "asset_id",
4775+ "isExpression": false,
4776+ "asc": true,
4777+ "nulls": "last"
4778+ },
4779+ {
4780+ "expression": "availability",
4781+ "isExpression": false,
4782+ "asc": true,
4783+ "nulls": "last"
4784+ }
4785+ ],
4786+ "isUnique": false,
4787+ "concurrently": false,
4788+ "method": "btree",
4789+ "with": {}
4790+ },
4791+ "listings_avail_price_idx": {
4792+ "name": "listings_avail_price_idx",
4793+ "columns": [
4794+ {
4795+ "expression": "availability",
4796+ "isExpression": false,
4797+ "asc": true,
4798+ "nulls": "last"
4799+ },
4800+ {
4801+ "expression": "price_usd",
4802+ "isExpression": false,
4803+ "asc": true,
4804+ "nulls": "last"
4805+ }
4806+ ],
4807+ "isUnique": false,
4808+ "concurrently": false,
4809+ "method": "btree",
4810+ "with": {}
4811+ },
4812+ "listings_ends_idx": {
4813+ "name": "listings_ends_idx",
4814+ "columns": [
4815+ {
4816+ "expression": "ends_at",
4817+ "isExpression": false,
4818+ "asc": true,
4819+ "nulls": "last"
4820+ }
4821+ ],
4822+ "isUnique": false,
4823+ "concurrently": false,
4824+ "method": "btree",
4825+ "with": {}
4826+ },
4827+ "listings_last_seen_idx": {
4828+ "name": "listings_last_seen_idx",
4829+ "columns": [
4830+ {
4831+ "expression": "last_seen_at",
4832+ "isExpression": false,
4833+ "asc": true,
4834+ "nulls": "last"
4835+ }
4836+ ],
4837+ "isUnique": false,
4838+ "concurrently": false,
4839+ "method": "btree",
4840+ "with": {}
4841+ },
4842+ "listings_variant_avail_idx": {
4843+ "name": "listings_variant_avail_idx",
4844+ "columns": [
4845+ {
4846+ "expression": "variant_id",
4847+ "isExpression": false,
4848+ "asc": true,
4849+ "nulls": "last"
4850+ },
4851+ {
4852+ "expression": "availability",
4853+ "isExpression": false,
4854+ "asc": true,
4855+ "nulls": "last"
4856+ }
4857+ ],
4858+ "isUnique": false,
4859+ "concurrently": false,
4860+ "method": "btree",
4861+ "with": {}
4862+ },
4863+ "listings_discount_idx": {
4864+ "name": "listings_discount_idx",
4865+ "columns": [
4866+ {
4867+ "expression": "discount_to_riv",
4868+ "isExpression": false,
4869+ "asc": true,
4870+ "nulls": "last"
4871+ }
4872+ ],
4873+ "isUnique": false,
4874+ "where": "discount_to_riv is not null and availability = 'available'",
4875+ "concurrently": false,
4876+ "method": "btree",
4877+ "with": {}
4878+ }
4879+ },
4880+ "foreignKeys": {},
4881+ "compositePrimaryKeys": {},
4882+ "uniqueConstraints": {},
4883+ "policies": {},
4884+ "checkConstraints": {},
4885+ "isRLSEnabled": false
4886+ },
4887+ "public.news": {
4888+ "name": "news",
4889+ "schema": "",
4890+ "columns": {
4891+ "id": {
4892+ "name": "id",
4893+ "type": "text",
4894+ "primaryKey": true,
4895+ "notNull": true
4896+ },
4897+ "source_id": {
4898+ "name": "source_id",
4899+ "type": "text",
4900+ "primaryKey": false,
4901+ "notNull": true
4902+ },
4903+ "url": {
4904+ "name": "url",
4905+ "type": "text",
4906+ "primaryKey": false,
4907+ "notNull": true
4908+ },
4909+ "title": {
4910+ "name": "title",
4911+ "type": "text",
4912+ "primaryKey": false,
4913+ "notNull": true
4914+ },
4915+ "summary": {
4916+ "name": "summary",
4917+ "type": "text",
4918+ "primaryKey": false,
4919+ "notNull": false
4920+ },
4921+ "ai_summary": {
4922+ "name": "ai_summary",
4923+ "type": "text",
4924+ "primaryKey": false,
4925+ "notNull": false
4926+ },
4927+ "published_at": {
4928+ "name": "published_at",
4929+ "type": "timestamp with time zone",
4930+ "primaryKey": false,
4931+ "notNull": false
4932+ },
4933+ "category_slugs": {
4934+ "name": "category_slugs",
4935+ "type": "text[]",
4936+ "primaryKey": false,
4937+ "notNull": true,
4938+ "default": "'{}'::text[]"
4939+ },
4940+ "news_type": {
4941+ "name": "news_type",
4942+ "type": "text",
4943+ "primaryKey": false,
4944+ "notNull": false
4945+ },
4946+ "image_url": {
4947+ "name": "image_url",
4948+ "type": "text",
4949+ "primaryKey": false,
4950+ "notNull": false
4951+ },
4952+ "fetched_at": {
4953+ "name": "fetched_at",
4954+ "type": "timestamp with time zone",
4955+ "primaryKey": false,
4956+ "notNull": true
4957+ }
4958+ },
4959+ "indexes": {
4960+ "news_url_uq": {
4961+ "name": "news_url_uq",
4962+ "columns": [
4963+ {
4964+ "expression": "url",
4965+ "isExpression": false,
4966+ "asc": true,
4967+ "nulls": "last"
4968+ }
4969+ ],
4970+ "isUnique": true,
4971+ "concurrently": false,
4972+ "method": "btree",
4973+ "with": {}
4974+ },
4975+ "news_published_idx": {
4976+ "name": "news_published_idx",
4977+ "columns": [
4978+ {
4979+ "expression": "published_at",
4980+ "isExpression": false,
4981+ "asc": true,
4982+ "nulls": "last"
4983+ }
4984+ ],
4985+ "isUnique": false,
4986+ "concurrently": false,
4987+ "method": "btree",
4988+ "with": {}
4989+ }
4990+ },
4991+ "foreignKeys": {},
4992+ "compositePrimaryKeys": {},
4993+ "uniqueConstraints": {},
4994+ "policies": {},
4995+ "checkConstraints": {},
4996+ "isRLSEnabled": false
4997+ },
4998+ "public.price_observations": {
4999+ "name": "price_observations",
5000+ "schema": "",
5001+ "columns": {
5002+ "id": {
5003+ "name": "id",
5004+ "type": "text",
5005+ "primaryKey": true,
5006+ "notNull": true
5007+ },
5008+ "asset_id": {
5009+ "name": "asset_id",
5010+ "type": "text",
5011+ "primaryKey": false,
5012+ "notNull": true
5013+ },
5014+ "variant_id": {
5015+ "name": "variant_id",
5016+ "type": "text",
5017+ "primaryKey": false,
5018+ "notNull": false
5019+ },
5020+ "source_id": {
5021+ "name": "source_id",
5022+ "type": "text",
5023+ "primaryKey": false,
5024+ "notNull": true
5025+ },
5026+ "connector_id": {
5027+ "name": "connector_id",
5028+ "type": "text",
5029+ "primaryKey": false,
5030+ "notNull": true
5031+ },
5032+ "raw_record_id": {
5033+ "name": "raw_record_id",
5034+ "type": "text",
5035+ "primaryKey": false,
5036+ "notNull": false
5037+ },
5038+ "source_url": {
5039+ "name": "source_url",
5040+ "type": "text",
5041+ "primaryKey": false,
5042+ "notNull": true
5043+ },
5044+ "price_kind": {
5045+ "name": "price_kind",
5046+ "type": "text",
5047+ "primaryKey": false,
5048+ "notNull": true
5049+ },
5050+ "price": {
5051+ "name": "price",
5052+ "type": "numeric(18, 4)",
5053+ "primaryKey": false,
5054+ "notNull": true
5055+ },
5056+ "currency": {
5057+ "name": "currency",
5058+ "type": "text",
5059+ "primaryKey": false,
5060+ "notNull": true
5061+ },
5062+ "price_usd": {
5063+ "name": "price_usd",
5064+ "type": "numeric(18, 4)",
5065+ "primaryKey": false,
5066+ "notNull": true
5067+ },
5068+ "observation_date": {
5069+ "name": "observation_date",
5070+ "type": "date",
5071+ "primaryKey": false,
5072+ "notNull": true
5073+ },
5074+ "sample_size": {
5075+ "name": "sample_size",
5076+ "type": "integer",
5077+ "primaryKey": false,
5078+ "notNull": false
5079+ },
5080+ "dedupe_key": {
5081+ "name": "dedupe_key",
5082+ "type": "text",
5083+ "primaryKey": false,
5084+ "notNull": true
5085+ },
5086+ "created_at": {
5087+ "name": "created_at",
5088+ "type": "timestamp with time zone",
5089+ "primaryKey": false,
5090+ "notNull": true,
5091+ "default": "now()"
5092+ }
5093+ },
5094+ "indexes": {
5095+ "price_observations_dedupe_uq": {
5096+ "name": "price_observations_dedupe_uq",
5097+ "columns": [
5098+ {
5099+ "expression": "dedupe_key",
5100+ "isExpression": false,
5101+ "asc": true,
5102+ "nulls": "last"
5103+ }
5104+ ],
5105+ "isUnique": true,
5106+ "concurrently": false,
5107+ "method": "btree",
5108+ "with": {}
5109+ },
5110+ "price_observations_asset_date_idx": {
5111+ "name": "price_observations_asset_date_idx",
5112+ "columns": [
5113+ {
5114+ "expression": "asset_id",
5115+ "isExpression": false,
5116+ "asc": true,
5117+ "nulls": "last"
5118+ },
5119+ {
5120+ "expression": "observation_date",
5121+ "isExpression": false,
5122+ "asc": true,
5123+ "nulls": "last"
5124+ }
5125+ ],
5126+ "isUnique": false,
5127+ "concurrently": false,
5128+ "method": "btree",
5129+ "with": {}
5130+ }
5131+ },
5132+ "foreignKeys": {},
5133+ "compositePrimaryKeys": {},
5134+ "uniqueConstraints": {},
5135+ "policies": {},
5136+ "checkConstraints": {},
5137+ "isRLSEnabled": false
5138+ },
5139+ "public.sales": {
5140+ "name": "sales",
5141+ "schema": "",
5142+ "columns": {
5143+ "id": {
5144+ "name": "id",
5145+ "type": "text",
5146+ "primaryKey": true,
5147+ "notNull": true
5148+ },
5149+ "asset_id": {
5150+ "name": "asset_id",
5151+ "type": "text",
5152+ "primaryKey": false,
5153+ "notNull": true
5154+ },
5155+ "variant_id": {
5156+ "name": "variant_id",
5157+ "type": "text",
5158+ "primaryKey": false,
5159+ "notNull": false
5160+ },
5161+ "source_id": {
5162+ "name": "source_id",
5163+ "type": "text",
5164+ "primaryKey": false,
5165+ "notNull": true
5166+ },
5167+ "connector_id": {
5168+ "name": "connector_id",
5169+ "type": "text",
5170+ "primaryKey": false,
5171+ "notNull": true
5172+ },
5173+ "raw_record_id": {
5174+ "name": "raw_record_id",
5175+ "type": "text",
5176+ "primaryKey": false,
5177+ "notNull": false
5178+ },
5179+ "normalized_record_id": {
5180+ "name": "normalized_record_id",
5181+ "type": "text",
5182+ "primaryKey": false,
5183+ "notNull": false
5184+ },
5185+ "source_url": {
5186+ "name": "source_url",
5187+ "type": "text",
5188+ "primaryKey": false,
5189+ "notNull": true
5190+ },
5191+ "external_id": {
5192+ "name": "external_id",
5193+ "type": "text",
5194+ "primaryKey": false,
5195+ "notNull": false
5196+ },
5197+ "sale_type": {
5198+ "name": "sale_type",
5199+ "type": "text",
5200+ "primaryKey": false,
5201+ "notNull": true,
5202+ "default": "'unknown'"
5203+ },
5204+ "sale_date": {
5205+ "name": "sale_date",
5206+ "type": "timestamp with time zone",
5207+ "primaryKey": false,
5208+ "notNull": true
5209+ },
5210+ "price": {
5211+ "name": "price",
5212+ "type": "numeric(18, 4)",
5213+ "primaryKey": false,
5214+ "notNull": true
5215+ },
5216+ "currency": {
5217+ "name": "currency",
5218+ "type": "text",
5219+ "primaryKey": false,
5220+ "notNull": true
5221+ },
5222+ "price_usd": {
5223+ "name": "price_usd",
5224+ "type": "numeric(18, 4)",
5225+ "primaryKey": false,
5226+ "notNull": true
5227+ },
5228+ "fx_rate": {
5229+ "name": "fx_rate",
5230+ "type": "real",
5231+ "primaryKey": false,
5232+ "notNull": false
5233+ },
5234+ "fx_date": {
5235+ "name": "fx_date",
5236+ "type": "date",
5237+ "primaryKey": false,
5238+ "notNull": false
5239+ },
5240+ "buyer_premium_included": {
5241+ "name": "buyer_premium_included",
5242+ "type": "boolean",
5243+ "primaryKey": false,
5244+ "notNull": false
5245+ },
5246+ "all_in_usd": {
5247+ "name": "all_in_usd",
5248+ "type": "numeric(18, 4)",
5249+ "primaryKey": false,
5250+ "notNull": false
5251+ },
5252+ "fee_basis": {
5253+ "name": "fee_basis",
5254+ "type": "text",
5255+ "primaryKey": false,
5256+ "notNull": false
5257+ },
5258+ "buyer_premium_rate": {
5259+ "name": "buyer_premium_rate",
5260+ "type": "real",
5261+ "primaryKey": false,
5262+ "notNull": false
5263+ },
5264+ "quantity": {
5265+ "name": "quantity",
5266+ "type": "integer",
5267+ "primaryKey": false,
5268+ "notNull": true,
5269+ "default": 1
5270+ },
5271+ "is_bundle": {
5272+ "name": "is_bundle",
5273+ "type": "boolean",
5274+ "primaryKey": false,
5275+ "notNull": true,
5276+ "default": false
5277+ },
5278+ "condition": {
5279+ "name": "condition",
5280+ "type": "text",
5281+ "primaryKey": false,
5282+ "notNull": false
5283+ },
5284+ "grader": {
5285+ "name": "grader",
5286+ "type": "text",
5287+ "primaryKey": false,
5288+ "notNull": false
5289+ },
5290+ "grade": {
5291+ "name": "grade",
5292+ "type": "text",
5293+ "primaryKey": false,
5294+ "notNull": false
5295+ },
5296+ "certification_number": {
5297+ "name": "certification_number",
5298+ "type": "text",
5299+ "primaryKey": false,
5300+ "notNull": false
5301+ },
5302+ "location": {
5303+ "name": "location",
5304+ "type": "text",
5305+ "primaryKey": false,
5306+ "notNull": false
5307+ },
5308+ "auction_house": {
5309+ "name": "auction_house",
5310+ "type": "text",
5311+ "primaryKey": false,
5312+ "notNull": false
5313+ },
5314+ "lot_number": {
5315+ "name": "lot_number",
5316+ "type": "text",
5317+ "primaryKey": false,
5318+ "notNull": false
5319+ },
5320+ "image_urls": {
5321+ "name": "image_urls",
5322+ "type": "jsonb",
5323+ "primaryKey": false,
5324+ "notNull": true,
5325+ "default": "'[]'::jsonb"
5326+ },
5327+ "raw_title": {
5328+ "name": "raw_title",
5329+ "type": "text",
5330+ "primaryKey": false,
5331+ "notNull": true
5332+ },
5333+ "confidence": {
5334+ "name": "confidence",
5335+ "type": "numeric(8, 6)",
5336+ "primaryKey": false,
5337+ "notNull": true,
5338+ "default": 0.8
5339+ },
5340+ "data_quality": {
5341+ "name": "data_quality",
5342+ "type": "real",
5343+ "primaryKey": false,
5344+ "notNull": true,
5345+ "default": 0
5346+ },
5347+ "status": {
5348+ "name": "status",
5349+ "type": "text",
5350+ "primaryKey": false,
5351+ "notNull": true,
5352+ "default": "'valid'"
5353+ },
5354+ "flags": {
5355+ "name": "flags",
5356+ "type": "text[]",
5357+ "primaryKey": false,
5358+ "notNull": true,
5359+ "default": "'{}'::text[]"
5360+ },
5361+ "dedupe_key": {
5362+ "name": "dedupe_key",
5363+ "type": "text",
5364+ "primaryKey": false,
5365+ "notNull": true
5366+ },
5367+ "created_at": {
5368+ "name": "created_at",
5369+ "type": "timestamp with time zone",
5370+ "primaryKey": false,
5371+ "notNull": true,
5372+ "default": "now()"
5373+ }
5374+ },
5375+ "indexes": {
5376+ "sales_dedupe_uq": {
5377+ "name": "sales_dedupe_uq",
5378+ "columns": [
5379+ {
5380+ "expression": "dedupe_key",
5381+ "isExpression": false,
5382+ "asc": true,
5383+ "nulls": "last"
5384+ }
5385+ ],
5386+ "isUnique": true,
5387+ "concurrently": false,
5388+ "method": "btree",
5389+ "with": {}
5390+ },
5391+ "sales_asset_date_idx": {
5392+ "name": "sales_asset_date_idx",
5393+ "columns": [
5394+ {
5395+ "expression": "asset_id",
5396+ "isExpression": false,
5397+ "asc": true,
5398+ "nulls": "last"
5399+ },
5400+ {
5401+ "expression": "sale_date",
5402+ "isExpression": false,
5403+ "asc": true,
5404+ "nulls": "last"
5405+ }
5406+ ],
5407+ "isUnique": false,
5408+ "concurrently": false,
5409+ "method": "btree",
5410+ "with": {}
5411+ },
5412+ "sales_variant_date_idx": {
5413+ "name": "sales_variant_date_idx",
5414+ "columns": [
5415+ {
5416+ "expression": "variant_id",
5417+ "isExpression": false,
5418+ "asc": true,
5419+ "nulls": "last"
5420+ },
5421+ {
5422+ "expression": "sale_date",
5423+ "isExpression": false,
5424+ "asc": true,
5425+ "nulls": "last"
5426+ }
5427+ ],
5428+ "isUnique": false,
5429+ "concurrently": false,
5430+ "method": "btree",
5431+ "with": {}
5432+ },
5433+ "sales_source_idx": {
5434+ "name": "sales_source_idx",
5435+ "columns": [
5436+ {
5437+ "expression": "source_id",
5438+ "isExpression": false,
5439+ "asc": true,
5440+ "nulls": "last"
5441+ },
5442+ {
5443+ "expression": "sale_date",
5444+ "isExpression": false,
5445+ "asc": true,
5446+ "nulls": "last"
5447+ }
5448+ ],
5449+ "isUnique": false,
5450+ "concurrently": false,
5451+ "method": "btree",
5452+ "with": {}
5453+ },
5454+ "sales_date_idx": {
5455+ "name": "sales_date_idx",
5456+ "columns": [
5457+ {
5458+ "expression": "sale_date",
5459+ "isExpression": false,
5460+ "asc": true,
5461+ "nulls": "last"
5462+ }
5463+ ],
5464+ "isUnique": false,
5465+ "concurrently": false,
5466+ "method": "btree",
5467+ "with": {}
5468+ },
5469+ "sales_price_idx": {
5470+ "name": "sales_price_idx",
5471+ "columns": [
5472+ {
5473+ "expression": "price_usd",
5474+ "isExpression": false,
5475+ "asc": true,
5476+ "nulls": "last"
5477+ }
5478+ ],
5479+ "isUnique": false,
5480+ "concurrently": false,
5481+ "method": "btree",
5482+ "with": {}
5483+ },
5484+ "sales_valid_date_idx": {
5485+ "name": "sales_valid_date_idx",
5486+ "columns": [
5487+ {
5488+ "expression": "sale_date",
5489+ "isExpression": false,
5490+ "asc": true,
5491+ "nulls": "last"
5492+ }
5493+ ],
5494+ "isUnique": false,
5495+ "where": "status = 'valid'",
5496+ "concurrently": false,
5497+ "method": "btree",
5498+ "with": {}
5499+ }
5500+ },
5501+ "foreignKeys": {},
5502+ "compositePrimaryKeys": {},
5503+ "uniqueConstraints": {},
5504+ "policies": {},
5505+ "checkConstraints": {},
5506+ "isRLSEnabled": false
5507+ },
5508+ "public.benchmarks": {
5509+ "name": "benchmarks",
5510+ "schema": "",
5511+ "columns": {
5512+ "ticker": {
5513+ "name": "ticker",
5514+ "type": "text",
5515+ "primaryKey": false,
5516+ "notNull": true
5517+ },
5518+ "date": {
5519+ "name": "date",
5520+ "type": "date",
5521+ "primaryKey": false,
5522+ "notNull": true
5523+ },
5524+ "value": {
5525+ "name": "value",
5526+ "type": "real",
5527+ "primaryKey": false,
5528+ "notNull": true
5529+ },
5530+ "source": {
5531+ "name": "source",
5532+ "type": "text",
5533+ "primaryKey": false,
5534+ "notNull": true
5535+ }
5536+ },
5537+ "indexes": {},
5538+ "foreignKeys": {},
5539+ "compositePrimaryKeys": {
5540+ "benchmarks_ticker_date_pk": {
5541+ "name": "benchmarks_ticker_date_pk",
5542+ "columns": [
5543+ "ticker",
5544+ "date"
5545+ ]
5546+ }
5547+ },
5548+ "uniqueConstraints": {},
5549+ "policies": {},
5550+ "checkConstraints": {},
5551+ "isRLSEnabled": false
5552+ },
5553+ "public.category_snapshots": {
5554+ "name": "category_snapshots",
5555+ "schema": "",
5556+ "columns": {
5557+ "category_slug": {
5558+ "name": "category_slug",
5559+ "type": "text",
5560+ "primaryKey": false,
5561+ "notNull": true
5562+ },
5563+ "date": {
5564+ "name": "date",
5565+ "type": "date",
5566+ "primaryKey": false,
5567+ "notNull": true
5568+ },
5569+ "index_value": {
5570+ "name": "index_value",
5571+ "type": "real",
5572+ "primaryKey": false,
5573+ "notNull": false
5574+ },
5575+ "tracked_assets": {
5576+ "name": "tracked_assets",
5577+ "type": "integer",
5578+ "primaryKey": false,
5579+ "notNull": true,
5580+ "default": 0
5581+ },
5582+ "assets_with_valuation": {
5583+ "name": "assets_with_valuation",
5584+ "type": "integer",
5585+ "primaryKey": false,
5586+ "notNull": true,
5587+ "default": 0
5588+ },
5589+ "sales": {
5590+ "name": "sales",
5591+ "type": "integer",
5592+ "primaryKey": false,
5593+ "notNull": true,
5594+ "default": 0
5595+ },
5596+ "volume_usd": {
5597+ "name": "volume_usd",
5598+ "type": "numeric(18, 4)",
5599+ "primaryKey": false,
5600+ "notNull": false
5601+ },
5602+ "median_sale_usd": {
5603+ "name": "median_sale_usd",
5604+ "type": "numeric(18, 4)",
5605+ "primaryKey": false,
5606+ "notNull": false
5607+ },
5608+ "active_listings": {
5609+ "name": "active_listings",
5610+ "type": "integer",
5611+ "primaryKey": false,
5612+ "notNull": true,
5613+ "default": 0
5614+ },
5615+ "market_cap_est_usd": {
5616+ "name": "market_cap_est_usd",
5617+ "type": "numeric(18, 4)",
5618+ "primaryKey": false,
5619+ "notNull": false
5620+ },
5621+ "liquidity_score": {
5622+ "name": "liquidity_score",
5623+ "type": "real",
5624+ "primaryKey": false,
5625+ "notNull": false
5626+ },
5627+ "change_1d": {
5628+ "name": "change_1d",
5629+ "type": "numeric(8, 6)",
5630+ "primaryKey": false,
5631+ "notNull": false
5632+ },
5633+ "change_7d": {
5634+ "name": "change_7d",
5635+ "type": "numeric(8, 6)",
5636+ "primaryKey": false,
5637+ "notNull": false
5638+ },
5639+ "change_30d": {
5640+ "name": "change_30d",
5641+ "type": "numeric(8, 6)",
5642+ "primaryKey": false,
5643+ "notNull": false
5644+ },
5645+ "change_1y": {
5646+ "name": "change_1y",
5647+ "type": "numeric(8, 6)",
5648+ "primaryKey": false,
5649+ "notNull": false
5650+ }
5651+ },
5652+ "indexes": {},
5653+ "foreignKeys": {},
5654+ "compositePrimaryKeys": {
5655+ "category_snapshots_category_slug_date_pk": {
5656+ "name": "category_snapshots_category_slug_date_pk",
5657+ "columns": [
5658+ "category_slug",
5659+ "date"
5660+ ]
5661+ }
5662+ },
5663+ "uniqueConstraints": {},
5664+ "policies": {},
5665+ "checkConstraints": {},
5666+ "isRLSEnabled": false
5667+ },
5668+ "public.correlations": {
5669+ "name": "correlations",
5670+ "schema": "",
5671+ "columns": {
5672+ "a": {
5673+ "name": "a",
5674+ "type": "text",
5675+ "primaryKey": false,
5676+ "notNull": true
5677+ },
5678+ "b": {
5679+ "name": "b",
5680+ "type": "text",
5681+ "primaryKey": false,
5682+ "notNull": true
5683+ },
5684+ "window_days": {
5685+ "name": "window_days",
5686+ "type": "integer",
5687+ "primaryKey": false,
5688+ "notNull": true
5689+ },
5690+ "coefficient": {
5691+ "name": "coefficient",
5692+ "type": "real",
5693+ "primaryKey": false,
5694+ "notNull": true
5695+ },
5696+ "observations": {
5697+ "name": "observations",
5698+ "type": "integer",
5699+ "primaryKey": false,
5700+ "notNull": true
5701+ },
5702+ "computed_at": {
5703+ "name": "computed_at",
5704+ "type": "timestamp with time zone",
5705+ "primaryKey": false,
5706+ "notNull": true
5707+ }
5708+ },
5709+ "indexes": {},
5710+ "foreignKeys": {},
5711+ "compositePrimaryKeys": {
5712+ "correlations_a_b_window_days_pk": {
5713+ "name": "correlations_a_b_window_days_pk",
5714+ "columns": [
5715+ "a",
5716+ "b",
5717+ "window_days"
5718+ ]
5719+ }
5720+ },
5721+ "uniqueConstraints": {},
5722+ "policies": {},
5723+ "checkConstraints": {},
5724+ "isRLSEnabled": false
5725+ },
5726+ "public.index_constituents": {
5727+ "name": "index_constituents",
5728+ "schema": "",
5729+ "columns": {
5730+ "index_id": {
5731+ "name": "index_id",
5732+ "type": "text",
5733+ "primaryKey": false,
5734+ "notNull": true
5735+ },
5736+ "asset_id": {
5737+ "name": "asset_id",
5738+ "type": "text",
5739+ "primaryKey": false,
5740+ "notNull": true
5741+ },
5742+ "variant_id": {
5743+ "name": "variant_id",
5744+ "type": "text",
5745+ "primaryKey": false,
5746+ "notNull": true,
5747+ "default": "''"
5748+ },
5749+ "weight": {
5750+ "name": "weight",
5751+ "type": "real",
5752+ "primaryKey": false,
5753+ "notNull": true,
5754+ "default": 1
5755+ },
5756+ "added_at": {
5757+ "name": "added_at",
5758+ "type": "date",
5759+ "primaryKey": false,
5760+ "notNull": true
5761+ },
5762+ "removed_at": {
5763+ "name": "removed_at",
5764+ "type": "date",
5765+ "primaryKey": false,
5766+ "notNull": false
5767+ },
5768+ "reason": {
5769+ "name": "reason",
5770+ "type": "text",
5771+ "primaryKey": false,
5772+ "notNull": false
5773+ }
5774+ },
5775+ "indexes": {
5776+ "index_constituents_asset_idx": {
5777+ "name": "index_constituents_asset_idx",
5778+ "columns": [
5779+ {
5780+ "expression": "asset_id",
5781+ "isExpression": false,
5782+ "asc": true,
5783+ "nulls": "last"
5784+ }
5785+ ],
5786+ "isUnique": false,
5787+ "concurrently": false,
5788+ "method": "btree",
5789+ "with": {}
5790+ }
5791+ },
5792+ "foreignKeys": {},
5793+ "compositePrimaryKeys": {
5794+ "index_constituents_index_id_asset_id_variant_id_added_at_pk": {
5795+ "name": "index_constituents_index_id_asset_id_variant_id_added_at_pk",
5796+ "columns": [
5797+ "index_id",
5798+ "asset_id",
5799+ "variant_id",
5800+ "added_at"
5801+ ]
5802+ }
5803+ },
5804+ "uniqueConstraints": {},
5805+ "policies": {},
5806+ "checkConstraints": {},
5807+ "isRLSEnabled": false
5808+ },
5809+ "public.index_values": {
5810+ "name": "index_values",
5811+ "schema": "",
5812+ "columns": {
5813+ "index_id": {
5814+ "name": "index_id",
5815+ "type": "text",
5816+ "primaryKey": false,
5817+ "notNull": true
5818+ },
5819+ "date": {
5820+ "name": "date",
5821+ "type": "date",
5822+ "primaryKey": false,
5823+ "notNull": true
5824+ },
5825+ "value": {
5826+ "name": "value",
5827+ "type": "real",
5828+ "primaryKey": false,
5829+ "notNull": true
5830+ },
5831+ "constituents_count": {
5832+ "name": "constituents_count",
5833+ "type": "integer",
5834+ "primaryKey": false,
5835+ "notNull": true,
5836+ "default": 0
5837+ },
5838+ "transactions": {
5839+ "name": "transactions",
5840+ "type": "integer",
5841+ "primaryKey": false,
5842+ "notNull": true,
5843+ "default": 0
5844+ },
5845+ "volume_usd": {
5846+ "name": "volume_usd",
5847+ "type": "numeric(18, 4)",
5848+ "primaryKey": false,
5849+ "notNull": false
5850+ },
5851+ "median_sale_usd": {
5852+ "name": "median_sale_usd",
5853+ "type": "numeric(18, 4)",
5854+ "primaryKey": false,
5855+ "notNull": false
5856+ },
5857+ "avg_sale_usd": {
5858+ "name": "avg_sale_usd",
5859+ "type": "numeric(18, 4)",
5860+ "primaryKey": false,
5861+ "notNull": false
5862+ },
5863+ "market_cap_est_usd": {
5864+ "name": "market_cap_est_usd",
5865+ "type": "numeric(18, 4)",
5866+ "primaryKey": false,
5867+ "notNull": false
5868+ },
5869+ "market_cap_confidence": {
5870+ "name": "market_cap_confidence",
5871+ "type": "text",
5872+ "primaryKey": false,
5873+ "notNull": false
5874+ },
5875+ "liquidity_score": {
5876+ "name": "liquidity_score",
5877+ "type": "real",
5878+ "primaryKey": false,
5879+ "notNull": false
5880+ },
5881+ "momentum": {
5882+ "name": "momentum",
5883+ "type": "real",
5884+ "primaryKey": false,
5885+ "notNull": false
5886+ },
5887+ "breadth": {
5888+ "name": "breadth",
5889+ "type": "integer",
5890+ "primaryKey": false,
5891+ "notNull": false
5892+ },
5893+ "tracked_assets": {
5894+ "name": "tracked_assets",
5895+ "type": "integer",
5896+ "primaryKey": false,
5897+ "notNull": false
5898+ },
5899+ "coverage": {
5900+ "name": "coverage",
5901+ "type": "real",
5902+ "primaryKey": false,
5903+ "notNull": false
5904+ }
5905+ },
5906+ "indexes": {},
5907+ "foreignKeys": {},
5908+ "compositePrimaryKeys": {
5909+ "index_values_index_id_date_pk": {
5910+ "name": "index_values_index_id_date_pk",
5911+ "columns": [
5912+ "index_id",
5913+ "date"
5914+ ]
5915+ }
5916+ },
5917+ "uniqueConstraints": {},
5918+ "policies": {},
5919+ "checkConstraints": {},
5920+ "isRLSEnabled": false
5921+ },
5922+ "public.indices": {
5923+ "name": "indices",
5924+ "schema": "",
5925+ "columns": {
5926+ "id": {
5927+ "name": "id",
5928+ "type": "text",
5929+ "primaryKey": true,
5930+ "notNull": true
5931+ },
5932+ "ticker": {
5933+ "name": "ticker",
5934+ "type": "text",
5935+ "primaryKey": false,
5936+ "notNull": true
5937+ },
5938+ "name": {
5939+ "name": "name",
5940+ "type": "text",
5941+ "primaryKey": false,
5942+ "notNull": true
5943+ },
5944+ "description": {
5945+ "name": "description",
5946+ "type": "text",
5947+ "primaryKey": false,
5948+ "notNull": false
5949+ },
5950+ "category_slugs": {
5951+ "name": "category_slugs",
5952+ "type": "text[]",
5953+ "primaryKey": false,
5954+ "notNull": true,
5955+ "default": "'{}'::text[]"
5956+ },
5957+ "family_slugs": {
5958+ "name": "family_slugs",
5959+ "type": "text[]",
5960+ "primaryKey": false,
5961+ "notNull": true,
5962+ "default": "'{}'::text[]"
5963+ },
5964+ "parent_ticker": {
5965+ "name": "parent_ticker",
5966+ "type": "text",
5967+ "primaryKey": false,
5968+ "notNull": false
5969+ },
5970+ "methodology": {
5971+ "name": "methodology",
5972+ "type": "text",
5973+ "primaryKey": false,
5974+ "notNull": true,
5975+ "default": "'chain_linked_equal_weight_v1'"
5976+ },
5977+ "weighting": {
5978+ "name": "weighting",
5979+ "type": "text",
5980+ "primaryKey": false,
5981+ "notNull": true,
5982+ "default": "'equal'"
5983+ },
5984+ "base_date": {
5985+ "name": "base_date",
5986+ "type": "date",
5987+ "primaryKey": false,
5988+ "notNull": true
5989+ },
5990+ "base_value": {
5991+ "name": "base_value",
5992+ "type": "real",
5993+ "primaryKey": false,
5994+ "notNull": true,
5995+ "default": 1000
5996+ },
5997+ "min_constituents": {
5998+ "name": "min_constituents",
5999+ "type": "integer",
6000+ "primaryKey": false,
6001+ "notNull": true,
6002+ "default": 10
6003+ },
6004+ "active": {
6005+ "name": "active",
6006+ "type": "boolean",
6007+ "primaryKey": false,
6008+ "notNull": true,
6009+ "default": true
6010+ },
6011+ "is_flagship": {
6012+ "name": "is_flagship",
6013+ "type": "boolean",
6014+ "primaryKey": false,
6015+ "notNull": true,
6016+ "default": false
6017+ },
6018+ "color": {
6019+ "name": "color",
6020+ "type": "text",
6021+ "primaryKey": false,
6022+ "notNull": false
6023+ },
6024+ "created_at": {
6025+ "name": "created_at",
6026+ "type": "timestamp with time zone",
6027+ "primaryKey": false,
6028+ "notNull": true,
6029+ "default": "now()"
6030+ }
6031+ },
6032+ "indexes": {},
6033+ "foreignKeys": {},
6034+ "compositePrimaryKeys": {},
6035+ "uniqueConstraints": {
6036+ "indices_ticker_unique": {
6037+ "name": "indices_ticker_unique",
6038+ "nullsNotDistinct": false,
6039+ "columns": [
6040+ "ticker"
6041+ ]
6042+ }
6043+ },
6044+ "policies": {},
6045+ "checkConstraints": {},
6046+ "isRLSEnabled": false
6047+ },
6048+ "public.price_snapshots": {
6049+ "name": "price_snapshots",
6050+ "schema": "",
6051+ "columns": {
6052+ "asset_id": {
6053+ "name": "asset_id",
6054+ "type": "text",
6055+ "primaryKey": false,
6056+ "notNull": true
6057+ },
6058+ "variant_id": {
6059+ "name": "variant_id",
6060+ "type": "text",
6061+ "primaryKey": false,
6062+ "notNull": true,
6063+ "default": "''"
6064+ },
6065+ "date": {
6066+ "name": "date",
6067+ "type": "date",
6068+ "primaryKey": false,
6069+ "notNull": true
6070+ },
6071+ "riv_usd": {
6072+ "name": "riv_usd",
6073+ "type": "numeric(18, 4)",
6074+ "primaryKey": false,
6075+ "notNull": false
6076+ },
6077+ "latest_sale_usd": {
6078+ "name": "latest_sale_usd",
6079+ "type": "numeric(18, 4)",
6080+ "primaryKey": false,
6081+ "notNull": false
6082+ },
6083+ "median_usd": {
6084+ "name": "median_usd",
6085+ "type": "numeric(18, 4)",
6086+ "primaryKey": false,
6087+ "notNull": false
6088+ },
6089+ "sales_count": {
6090+ "name": "sales_count",
6091+ "type": "integer",
6092+ "primaryKey": false,
6093+ "notNull": true,
6094+ "default": 0
6095+ },
6096+ "volume_usd": {
6097+ "name": "volume_usd",
6098+ "type": "numeric(18, 4)",
6099+ "primaryKey": false,
6100+ "notNull": false
6101+ },
6102+ "listings_count": {
6103+ "name": "listings_count",
6104+ "type": "integer",
6105+ "primaryKey": false,
6106+ "notNull": true,
6107+ "default": 0
6108+ },
6109+ "min_ask_usd": {
6110+ "name": "min_ask_usd",
6111+ "type": "numeric(18, 4)",
6112+ "primaryKey": false,
6113+ "notNull": false
6114+ },
6115+ "observation_usd": {
6116+ "name": "observation_usd",
6117+ "type": "numeric(18, 4)",
6118+ "primaryKey": false,
6119+ "notNull": false
6120+ }
6121+ },
6122+ "indexes": {
6123+ "price_snapshots_date_idx": {
6124+ "name": "price_snapshots_date_idx",
6125+ "columns": [
6126+ {
6127+ "expression": "date",
6128+ "isExpression": false,
6129+ "asc": true,
6130+ "nulls": "last"
6131+ }
6132+ ],
6133+ "isUnique": false,
6134+ "concurrently": false,
6135+ "method": "btree",
6136+ "with": {}
6137+ }
6138+ },
6139+ "foreignKeys": {},
6140+ "compositePrimaryKeys": {
6141+ "price_snapshots_asset_id_variant_id_date_pk": {
6142+ "name": "price_snapshots_asset_id_variant_id_date_pk",
6143+ "columns": [
6144+ "asset_id",
6145+ "variant_id",
6146+ "date"
6147+ ]
6148+ }
6149+ },
6150+ "uniqueConstraints": {},
6151+ "policies": {},
6152+ "checkConstraints": {},
6153+ "isRLSEnabled": false
6154+ },
6155+ "public.radar_findings": {
6156+ "name": "radar_findings",
6157+ "schema": "",
6158+ "columns": {
6159+ "id": {
6160+ "name": "id",
6161+ "type": "text",
6162+ "primaryKey": true,
6163+ "notNull": true
6164+ },
6165+ "asset_id": {
6166+ "name": "asset_id",
6167+ "type": "text",
6168+ "primaryKey": false,
6169+ "notNull": true
6170+ },
6171+ "kind": {
6172+ "name": "kind",
6173+ "type": "text",
6174+ "primaryKey": false,
6175+ "notNull": true
6176+ },
6177+ "score": {
6178+ "name": "score",
6179+ "type": "real",
6180+ "primaryKey": false,
6181+ "notNull": true
6182+ },
6183+ "evidence": {
6184+ "name": "evidence",
6185+ "type": "jsonb",
6186+ "primaryKey": false,
6187+ "notNull": true,
6188+ "default": "'{}'::jsonb"
6189+ },
6190+ "entity_type": {
6191+ "name": "entity_type",
6192+ "type": "text",
6193+ "primaryKey": false,
6194+ "notNull": false
6195+ },
6196+ "entity_id": {
6197+ "name": "entity_id",
6198+ "type": "text",
6199+ "primaryKey": false,
6200+ "notNull": false
6201+ },
6202+ "detected_at": {
6203+ "name": "detected_at",
6204+ "type": "timestamp with time zone",
6205+ "primaryKey": false,
6206+ "notNull": true
6207+ },
6208+ "expires_at": {
6209+ "name": "expires_at",
6210+ "type": "timestamp with time zone",
6211+ "primaryKey": false,
6212+ "notNull": false
6213+ }
6214+ },
6215+ "indexes": {
6216+ "radar_kind_idx": {
6217+ "name": "radar_kind_idx",
6218+ "columns": [
6219+ {
6220+ "expression": "kind",
6221+ "isExpression": false,
6222+ "asc": true,
6223+ "nulls": "last"
6224+ },
6225+ {
6226+ "expression": "detected_at",
6227+ "isExpression": false,
6228+ "asc": true,
6229+ "nulls": "last"
6230+ }
6231+ ],
6232+ "isUnique": false,
6233+ "concurrently": false,
6234+ "method": "btree",
6235+ "with": {}
6236+ },
6237+ "radar_entity_uq": {
6238+ "name": "radar_entity_uq",
6239+ "columns": [
6240+ {
6241+ "expression": "kind",
6242+ "isExpression": false,
6243+ "asc": true,
6244+ "nulls": "last"
6245+ },
6246+ {
6247+ "expression": "entity_type",
6248+ "isExpression": false,
6249+ "asc": true,
6250+ "nulls": "last"
6251+ },
6252+ {
6253+ "expression": "entity_id",
6254+ "isExpression": false,
6255+ "asc": true,
6256+ "nulls": "last"
6257+ }
6258+ ],
6259+ "isUnique": true,
6260+ "concurrently": false,
6261+ "method": "btree",
6262+ "with": {}
6263+ }
6264+ },
6265+ "foreignKeys": {},
6266+ "compositePrimaryKeys": {},
6267+ "uniqueConstraints": {},
6268+ "policies": {},
6269+ "checkConstraints": {},
6270+ "isRLSEnabled": false
6271+ },
6272+ "public.valuations": {
6273+ "name": "valuations",
6274+ "schema": "",
6275+ "columns": {
6276+ "id": {
6277+ "name": "id",
6278+ "type": "text",
6279+ "primaryKey": true,
6280+ "notNull": true
6281+ },
6282+ "asset_id": {
6283+ "name": "asset_id",
6284+ "type": "text",
6285+ "primaryKey": false,
6286+ "notNull": true
6287+ },
6288+ "variant_id": {
6289+ "name": "variant_id",
6290+ "type": "text",
6291+ "primaryKey": false,
6292+ "notNull": false
6293+ },
6294+ "computed_at": {
6295+ "name": "computed_at",
6296+ "type": "timestamp with time zone",
6297+ "primaryKey": false,
6298+ "notNull": true
6299+ },
6300+ "riv_usd": {
6301+ "name": "riv_usd",
6302+ "type": "numeric(18, 4)",
6303+ "primaryKey": false,
6304+ "notNull": false
6305+ },
6306+ "low_usd": {
6307+ "name": "low_usd",
6308+ "type": "numeric(18, 4)",
6309+ "primaryKey": false,
6310+ "notNull": false
6311+ },
6312+ "high_usd": {
6313+ "name": "high_usd",
6314+ "type": "numeric(18, 4)",
6315+ "primaryKey": false,
6316+ "notNull": false
6317+ },
6318+ "confidence": {
6319+ "name": "confidence",
6320+ "type": "numeric(8, 6)",
6321+ "primaryKey": false,
6322+ "notNull": true,
6323+ "default": 0
6324+ },
6325+ "confidence_label": {
6326+ "name": "confidence_label",
6327+ "type": "text",
6328+ "primaryKey": false,
6329+ "notNull": true,
6330+ "default": "'insufficient'"
6331+ },
6332+ "sample_size": {
6333+ "name": "sample_size",
6334+ "type": "integer",
6335+ "primaryKey": false,
6336+ "notNull": true,
6337+ "default": 0
6338+ },
6339+ "window_days": {
6340+ "name": "window_days",
6341+ "type": "integer",
6342+ "primaryKey": false,
6343+ "notNull": true,
6344+ "default": 365
6345+ },
6346+ "methods": {
6347+ "name": "methods",
6348+ "type": "jsonb",
6349+ "primaryKey": false,
6350+ "notNull": true,
6351+ "default": "'{}'::jsonb"
6352+ },
6353+ "sales_used": {
6354+ "name": "sales_used",
6355+ "type": "text[]",
6356+ "primaryKey": false,
6357+ "notNull": true,
6358+ "default": "'{}'::text[]"
6359+ },
6360+ "observations_used": {
6361+ "name": "observations_used",
6362+ "type": "integer",
6363+ "primaryKey": false,
6364+ "notNull": true,
6365+ "default": 0
6366+ },
6367+ "method": {
6368+ "name": "method",
6369+ "type": "text",
6370+ "primaryKey": false,
6371+ "notNull": true,
6372+ "default": "'ensemble_v1'"
6373+ },
6374+ "notes": {
6375+ "name": "notes",
6376+ "type": "text[]",
6377+ "primaryKey": false,
6378+ "notNull": true,
6379+ "default": "'{}'::text[]"
6380+ }
6381+ },
6382+ "indexes": {
6383+ "valuations_asset_idx": {
6384+ "name": "valuations_asset_idx",
6385+ "columns": [
6386+ {
6387+ "expression": "asset_id",
6388+ "isExpression": false,
6389+ "asc": true,
6390+ "nulls": "last"
6391+ },
6392+ {
6393+ "expression": "computed_at",
6394+ "isExpression": false,
6395+ "asc": true,
6396+ "nulls": "last"
6397+ }
6398+ ],
6399+ "isUnique": false,
6400+ "concurrently": false,
6401+ "method": "btree",
6402+ "with": {}
6403+ },
6404+ "valuations_variant_idx": {
6405+ "name": "valuations_variant_idx",
6406+ "columns": [
6407+ {
6408+ "expression": "variant_id",
6409+ "isExpression": false,
6410+ "asc": true,
6411+ "nulls": "last"
6412+ },
6413+ {
6414+ "expression": "computed_at",
6415+ "isExpression": false,
6416+ "asc": true,
6417+ "nulls": "last"
6418+ }
6419+ ],
6420+ "isUnique": false,
6421+ "concurrently": false,
6422+ "method": "btree",
6423+ "with": {}
6424+ }
6425+ },
6426+ "foreignKeys": {},
6427+ "compositePrimaryKeys": {},
6428+ "uniqueConstraints": {},
6429+ "policies": {},
6430+ "checkConstraints": {},
6431+ "isRLSEnabled": false
6432+ },
6433+ "public.alert_events": {
6434+ "name": "alert_events",
6435+ "schema": "",
6436+ "columns": {
6437+ "id": {
6438+ "name": "id",
6439+ "type": "text",
6440+ "primaryKey": true,
6441+ "notNull": true
6442+ },
6443+ "alert_id": {
6444+ "name": "alert_id",
6445+ "type": "text",
6446+ "primaryKey": false,
6447+ "notNull": true
6448+ },
6449+ "user_id": {
6450+ "name": "user_id",
6451+ "type": "text",
6452+ "primaryKey": false,
6453+ "notNull": true
6454+ },
6455+ "message": {
6456+ "name": "message",
6457+ "type": "text",
6458+ "primaryKey": false,
6459+ "notNull": true
6460+ },
6461+ "payload": {
6462+ "name": "payload",
6463+ "type": "jsonb",
6464+ "primaryKey": false,
6465+ "notNull": true,
6466+ "default": "'{}'::jsonb"
6467+ },
6468+ "read_at": {
6469+ "name": "read_at",
6470+ "type": "timestamp with time zone",
6471+ "primaryKey": false,
6472+ "notNull": false
6473+ },
6474+ "created_at": {
6475+ "name": "created_at",
6476+ "type": "timestamp with time zone",
6477+ "primaryKey": false,
6478+ "notNull": true,
6479+ "default": "now()"
6480+ }
6481+ },
6482+ "indexes": {
6483+ "alert_events_user_idx": {
6484+ "name": "alert_events_user_idx",
6485+ "columns": [
6486+ {
6487+ "expression": "user_id",
6488+ "isExpression": false,
6489+ "asc": true,
6490+ "nulls": "last"
6491+ },
6492+ {
6493+ "expression": "created_at",
6494+ "isExpression": false,
6495+ "asc": true,
6496+ "nulls": "last"
6497+ }
6498+ ],
6499+ "isUnique": false,
6500+ "concurrently": false,
6501+ "method": "btree",
6502+ "with": {}
6503+ }
6504+ },
6505+ "foreignKeys": {},
6506+ "compositePrimaryKeys": {},
6507+ "uniqueConstraints": {},
6508+ "policies": {},
6509+ "checkConstraints": {},
6510+ "isRLSEnabled": false
6511+ },
6512+ "public.alerts": {
6513+ "name": "alerts",
6514+ "schema": "",
6515+ "columns": {
6516+ "id": {
6517+ "name": "id",
6518+ "type": "text",
6519+ "primaryKey": true,
6520+ "notNull": true
6521+ },
6522+ "user_id": {
6523+ "name": "user_id",
6524+ "type": "text",
6525+ "primaryKey": false,
6526+ "notNull": true
6527+ },
6528+ "alert_type": {
6529+ "name": "alert_type",
6530+ "type": "text",
6531+ "primaryKey": false,
6532+ "notNull": true
6533+ },
6534+ "target_type": {
6535+ "name": "target_type",
6536+ "type": "text",
6537+ "primaryKey": false,
6538+ "notNull": true
6539+ },
6540+ "target_id": {
6541+ "name": "target_id",
6542+ "type": "text",
6543+ "primaryKey": false,
6544+ "notNull": true
6545+ },
6546+ "threshold": {
6547+ "name": "threshold",
6548+ "type": "numeric(18, 4)",
6549+ "primaryKey": false,
6550+ "notNull": false
6551+ },
6552+ "currency": {
6553+ "name": "currency",
6554+ "type": "text",
6555+ "primaryKey": false,
6556+ "notNull": false
6557+ },
6558+ "params": {
6559+ "name": "params",
6560+ "type": "jsonb",
6561+ "primaryKey": false,
6562+ "notNull": true,
6563+ "default": "'{}'::jsonb"
6564+ },
6565+ "channel": {
6566+ "name": "channel",
6567+ "type": "text",
6568+ "primaryKey": false,
6569+ "notNull": true,
6570+ "default": "'inapp'"
6571+ },
6572+ "active": {
6573+ "name": "active",
6574+ "type": "boolean",
6575+ "primaryKey": false,
6576+ "notNull": true,
6577+ "default": true
6578+ },
6579+ "name": {
6580+ "name": "name",
6581+ "type": "text",
6582+ "primaryKey": false,
6583+ "notNull": false
6584+ },
6585+ "cooldown_minutes": {
6586+ "name": "cooldown_minutes",
6587+ "type": "integer",
6588+ "primaryKey": false,
6589+ "notNull": true,
6590+ "default": 1440
6591+ },
6592+ "last_triggered_at": {
6593+ "name": "last_triggered_at",
6594+ "type": "timestamp with time zone",
6595+ "primaryKey": false,
6596+ "notNull": false
6597+ },
6598+ "trigger_count": {
6599+ "name": "trigger_count",
6600+ "type": "integer",
6601+ "primaryKey": false,
6602+ "notNull": true,
6603+ "default": 0
6604+ },
6605+ "created_at": {
6606+ "name": "created_at",
6607+ "type": "timestamp with time zone",
6608+ "primaryKey": false,
6609+ "notNull": true,
6610+ "default": "now()"
6611+ }
6612+ },
6613+ "indexes": {
6614+ "alerts_user_idx": {
6615+ "name": "alerts_user_idx",
6616+ "columns": [
6617+ {
6618+ "expression": "user_id",
6619+ "isExpression": false,
6620+ "asc": true,
6621+ "nulls": "last"
6622+ }
6623+ ],
6624+ "isUnique": false,
6625+ "concurrently": false,
6626+ "method": "btree",
6627+ "with": {}
6628+ },
6629+ "alerts_target_idx": {
6630+ "name": "alerts_target_idx",
6631+ "columns": [
6632+ {
6633+ "expression": "target_type",
6634+ "isExpression": false,
6635+ "asc": true,
6636+ "nulls": "last"
6637+ },
6638+ {
6639+ "expression": "target_id",
6640+ "isExpression": false,
6641+ "asc": true,
6642+ "nulls": "last"
6643+ },
6644+ {
6645+ "expression": "active",
6646+ "isExpression": false,
6647+ "asc": true,
6648+ "nulls": "last"
6649+ }
6650+ ],
6651+ "isUnique": false,
6652+ "concurrently": false,
6653+ "method": "btree",
6654+ "with": {}
6655+ }
6656+ },
6657+ "foreignKeys": {},
6658+ "compositePrimaryKeys": {},
6659+ "uniqueConstraints": {},
6660+ "policies": {},
6661+ "checkConstraints": {},
6662+ "isRLSEnabled": false
6663+ },
6664+ "public.api_keys": {
6665+ "name": "api_keys",
6666+ "schema": "",
6667+ "columns": {
6668+ "id": {
6669+ "name": "id",
6670+ "type": "text",
6671+ "primaryKey": true,
6672+ "notNull": true
6673+ },
6674+ "user_id": {
6675+ "name": "user_id",
6676+ "type": "text",
6677+ "primaryKey": false,
6678+ "notNull": false
6679+ },
6680+ "name": {
6681+ "name": "name",
6682+ "type": "text",
6683+ "primaryKey": false,
6684+ "notNull": true
6685+ },
6686+ "prefix": {
6687+ "name": "prefix",
6688+ "type": "text",
6689+ "primaryKey": false,
6690+ "notNull": true
6691+ },
6692+ "key_hash": {
6693+ "name": "key_hash",
6694+ "type": "text",
6695+ "primaryKey": false,
6696+ "notNull": true
6697+ },
6698+ "tier": {
6699+ "name": "tier",
6700+ "type": "text",
6701+ "primaryKey": false,
6702+ "notNull": true,
6703+ "default": "'free'"
6704+ },
6705+ "rate_limit_per_minute": {
6706+ "name": "rate_limit_per_minute",
6707+ "type": "integer",
6708+ "primaryKey": false,
6709+ "notNull": true,
6710+ "default": 60
6711+ },
6712+ "daily_quota": {
6713+ "name": "daily_quota",
6714+ "type": "integer",
6715+ "primaryKey": false,
6716+ "notNull": true,
6717+ "default": 1000
6718+ },
6719+ "created_at": {
6720+ "name": "created_at",
6721+ "type": "timestamp with time zone",
6722+ "primaryKey": false,
6723+ "notNull": true,
6724+ "default": "now()"
6725+ },
6726+ "last_used_at": {
6727+ "name": "last_used_at",
6728+ "type": "timestamp with time zone",
6729+ "primaryKey": false,
6730+ "notNull": false
6731+ },
6732+ "revoked_at": {
6733+ "name": "revoked_at",
6734+ "type": "timestamp with time zone",
6735+ "primaryKey": false,
6736+ "notNull": false
6737+ }
6738+ },
6739+ "indexes": {
6740+ "api_keys_user_idx": {
6741+ "name": "api_keys_user_idx",
6742+ "columns": [
6743+ {
6744+ "expression": "user_id",
6745+ "isExpression": false,
6746+ "asc": true,
6747+ "nulls": "last"
6748+ }
6749+ ],
6750+ "isUnique": false,
6751+ "concurrently": false,
6752+ "method": "btree",
6753+ "with": {}
6754+ }
6755+ },
6756+ "foreignKeys": {},
6757+ "compositePrimaryKeys": {},
6758+ "uniqueConstraints": {
6759+ "api_keys_key_hash_unique": {
6760+ "name": "api_keys_key_hash_unique",
6761+ "nullsNotDistinct": false,
6762+ "columns": [
6763+ "key_hash"
6764+ ]
6765+ }
6766+ },
6767+ "policies": {},
6768+ "checkConstraints": {},
6769+ "isRLSEnabled": false
6770+ },
6771+ "public.api_usage": {
6772+ "name": "api_usage",
6773+ "schema": "",
6774+ "columns": {
6775+ "key_id": {
6776+ "name": "key_id",
6777+ "type": "text",
6778+ "primaryKey": false,
6779+ "notNull": true
6780+ },
6781+ "date": {
6782+ "name": "date",
6783+ "type": "date",
6784+ "primaryKey": false,
6785+ "notNull": true
6786+ },
6787+ "endpoint": {
6788+ "name": "endpoint",
6789+ "type": "text",
6790+ "primaryKey": false,
6791+ "notNull": true
6792+ },
6793+ "count": {
6794+ "name": "count",
6795+ "type": "integer",
6796+ "primaryKey": false,
6797+ "notNull": true,
6798+ "default": 0
6799+ },
6800+ "latency_ms_avg": {
6801+ "name": "latency_ms_avg",
6802+ "type": "real",
6803+ "primaryKey": false,
6804+ "notNull": false
6805+ }
6806+ },
6807+ "indexes": {},
6808+ "foreignKeys": {},
6809+ "compositePrimaryKeys": {
6810+ "api_usage_key_id_date_endpoint_pk": {
6811+ "name": "api_usage_key_id_date_endpoint_pk",
6812+ "columns": [
6813+ "key_id",
6814+ "date",
6815+ "endpoint"
6816+ ]
6817+ }
6818+ },
6819+ "uniqueConstraints": {},
6820+ "policies": {},
6821+ "checkConstraints": {},
6822+ "isRLSEnabled": false
6823+ },
6824+ "public.asset_views": {
6825+ "name": "asset_views",
6826+ "schema": "",
6827+ "columns": {
6828+ "asset_id": {
6829+ "name": "asset_id",
6830+ "type": "text",
6831+ "primaryKey": false,
6832+ "notNull": true
6833+ },
6834+ "date": {
6835+ "name": "date",
6836+ "type": "date",
6837+ "primaryKey": false,
6838+ "notNull": true
6839+ },
6840+ "views": {
6841+ "name": "views",
6842+ "type": "integer",
6843+ "primaryKey": false,
6844+ "notNull": true,
6845+ "default": 0
6846+ }
6847+ },
6848+ "indexes": {},
6849+ "foreignKeys": {},
6850+ "compositePrimaryKeys": {
6851+ "asset_views_asset_id_date_pk": {
6852+ "name": "asset_views_asset_id_date_pk",
6853+ "columns": [
6854+ "asset_id",
6855+ "date"
6856+ ]
6857+ }
6858+ },
6859+ "uniqueConstraints": {},
6860+ "policies": {},
6861+ "checkConstraints": {},
6862+ "isRLSEnabled": false
6863+ },
6864+ "public.collection_items": {
6865+ "name": "collection_items",
6866+ "schema": "",
6867+ "columns": {
6868+ "id": {
6869+ "name": "id",
6870+ "type": "text",
6871+ "primaryKey": true,
6872+ "notNull": true
6873+ },
6874+ "collection_id": {
6875+ "name": "collection_id",
6876+ "type": "text",
6877+ "primaryKey": false,
6878+ "notNull": true
6879+ },
6880+ "asset_id": {
6881+ "name": "asset_id",
6882+ "type": "text",
6883+ "primaryKey": false,
6884+ "notNull": true
6885+ },
6886+ "variant_id": {
6887+ "name": "variant_id",
6888+ "type": "text",
6889+ "primaryKey": false,
6890+ "notNull": false
6891+ },
6892+ "quantity": {
6893+ "name": "quantity",
6894+ "type": "integer",
6895+ "primaryKey": false,
6896+ "notNull": true,
6897+ "default": 1
6898+ },
6899+ "acquired_at": {
6900+ "name": "acquired_at",
6901+ "type": "date",
6902+ "primaryKey": false,
6903+ "notNull": false
6904+ },
6905+ "purchase_price": {
6906+ "name": "purchase_price",
6907+ "type": "numeric(18, 4)",
6908+ "primaryKey": false,
6909+ "notNull": false
6910+ },
6911+ "purchase_currency": {
6912+ "name": "purchase_currency",
6913+ "type": "text",
6914+ "primaryKey": false,
6915+ "notNull": false
6916+ },
6917+ "purchase_price_usd": {
6918+ "name": "purchase_price_usd",
6919+ "type": "numeric(18, 4)",
6920+ "primaryKey": false,
6921+ "notNull": false
6922+ },
6923+ "source": {
6924+ "name": "source",
6925+ "type": "text",
6926+ "primaryKey": false,
6927+ "notNull": false
6928+ },
6929+ "grader": {
6930+ "name": "grader",
6931+ "type": "text",
6932+ "primaryKey": false,
6933+ "notNull": false
6934+ },
6935+ "grade": {
6936+ "name": "grade",
6937+ "type": "text",
6938+ "primaryKey": false,
6939+ "notNull": false
6940+ },
6941+ "certification_number": {
6942+ "name": "certification_number",
6943+ "type": "text",
6944+ "primaryKey": false,
6945+ "notNull": false
6946+ },
6947+ "serial": {
6948+ "name": "serial",
6949+ "type": "text",
6950+ "primaryKey": false,
6951+ "notNull": false
6952+ },
6953+ "photos": {
6954+ "name": "photos",
6955+ "type": "jsonb",
6956+ "primaryKey": false,
6957+ "notNull": true,
6958+ "default": "'[]'::jsonb"
6959+ },
6960+ "notes": {
6961+ "name": "notes",
6962+ "type": "text",
6963+ "primaryKey": false,
6964+ "notNull": false
6965+ },
6966+ "tags": {
6967+ "name": "tags",
6968+ "type": "jsonb",
6969+ "primaryKey": false,
6970+ "notNull": true,
6971+ "default": "'[]'::jsonb"
6972+ },
6973+ "condition": {
6974+ "name": "condition",
6975+ "type": "text",
6976+ "primaryKey": false,
6977+ "notNull": false
6978+ },
6979+ "manual_value_usd": {
6980+ "name": "manual_value_usd",
6981+ "type": "numeric(18, 4)",
6982+ "primaryKey": false,
6983+ "notNull": false
6984+ },
6985+ "sold_at": {
6986+ "name": "sold_at",
6987+ "type": "date",
6988+ "primaryKey": false,
6989+ "notNull": false
6990+ },
6991+ "sold_price_usd": {
6992+ "name": "sold_price_usd",
6993+ "type": "numeric(18, 4)",
6994+ "primaryKey": false,
6995+ "notNull": false
6996+ },
6997+ "created_at": {
6998+ "name": "created_at",
6999+ "type": "timestamp with time zone",
7000+ "primaryKey": false,
7001+ "notNull": true,
7002+ "default": "now()"
7003+ },
7004+ "updated_at": {
7005+ "name": "updated_at",
7006+ "type": "timestamp with time zone",
7007+ "primaryKey": false,
7008+ "notNull": true,
7009+ "default": "now()"
7010+ }
7011+ },
7012+ "indexes": {
7013+ "collection_items_collection_idx": {
7014+ "name": "collection_items_collection_idx",
7015+ "columns": [
7016+ {
7017+ "expression": "collection_id",
7018+ "isExpression": false,
7019+ "asc": true,
7020+ "nulls": "last"
7021+ }
7022+ ],
7023+ "isUnique": false,
7024+ "concurrently": false,
7025+ "method": "btree",
7026+ "with": {}
7027+ },
7028+ "collection_items_asset_idx": {
7029+ "name": "collection_items_asset_idx",
7030+ "columns": [
7031+ {
7032+ "expression": "asset_id",
7033+ "isExpression": false,
7034+ "asc": true,
7035+ "nulls": "last"
7036+ }
7037+ ],
7038+ "isUnique": false,
7039+ "concurrently": false,
7040+ "method": "btree",
7041+ "with": {}
7042+ }
7043+ },
7044+ "foreignKeys": {},
7045+ "compositePrimaryKeys": {},
7046+ "uniqueConstraints": {},
7047+ "policies": {},
7048+ "checkConstraints": {},
7049+ "isRLSEnabled": false
7050+ },
7051+ "public.collection_snapshots": {
7052+ "name": "collection_snapshots",
7053+ "schema": "",
7054+ "columns": {
7055+ "collection_id": {
7056+ "name": "collection_id",
7057+ "type": "text",
7058+ "primaryKey": false,
7059+ "notNull": true
7060+ },
7061+ "date": {
7062+ "name": "date",
7063+ "type": "date",
7064+ "primaryKey": false,
7065+ "notNull": true
7066+ },
7067+ "value_usd": {
7068+ "name": "value_usd",
7069+ "type": "numeric(18, 4)",
7070+ "primaryKey": false,
7071+ "notNull": true
7072+ },
7073+ "cost_basis_usd": {
7074+ "name": "cost_basis_usd",
7075+ "type": "numeric(18, 4)",
7076+ "primaryKey": false,
7077+ "notNull": true
7078+ },
7079+ "items": {
7080+ "name": "items",
7081+ "type": "integer",
7082+ "primaryKey": false,
7083+ "notNull": true
7084+ }
7085+ },
7086+ "indexes": {},
7087+ "foreignKeys": {},
7088+ "compositePrimaryKeys": {
7089+ "collection_snapshots_collection_id_date_pk": {
7090+ "name": "collection_snapshots_collection_id_date_pk",
7091+ "columns": [
7092+ "collection_id",
7093+ "date"
7094+ ]
7095+ }
7096+ },
7097+ "uniqueConstraints": {},
7098+ "policies": {},
7099+ "checkConstraints": {},
7100+ "isRLSEnabled": false
7101+ },
7102+ "public.collections": {
7103+ "name": "collections",
7104+ "schema": "",
7105+ "columns": {
7106+ "id": {
7107+ "name": "id",
7108+ "type": "text",
7109+ "primaryKey": true,
7110+ "notNull": true
7111+ },
7112+ "user_id": {
7113+ "name": "user_id",
7114+ "type": "text",
7115+ "primaryKey": false,
7116+ "notNull": true
7117+ },
7118+ "name": {
7119+ "name": "name",
7120+ "type": "text",
7121+ "primaryKey": false,
7122+ "notNull": true
7123+ },
7124+ "description": {
7125+ "name": "description",
7126+ "type": "text",
7127+ "primaryKey": false,
7128+ "notNull": false
7129+ },
7130+ "is_public": {
7131+ "name": "is_public",
7132+ "type": "boolean",
7133+ "primaryKey": false,
7134+ "notNull": true,
7135+ "default": false
7136+ },
7137+ "public_slug": {
7138+ "name": "public_slug",
7139+ "type": "text",
7140+ "primaryKey": false,
7141+ "notNull": false
7142+ },
7143+ "kind": {
7144+ "name": "kind",
7145+ "type": "text",
7146+ "primaryKey": false,
7147+ "notNull": true,
7148+ "default": "'collection'"
7149+ },
7150+ "budget_usd": {
7151+ "name": "budget_usd",
7152+ "type": "numeric(18, 4)",
7153+ "primaryKey": false,
7154+ "notNull": false
7155+ },
7156+ "color": {
7157+ "name": "color",
7158+ "type": "text",
7159+ "primaryKey": false,
7160+ "notNull": false
7161+ },
7162+ "created_at": {
7163+ "name": "created_at",
7164+ "type": "timestamp with time zone",
7165+ "primaryKey": false,
7166+ "notNull": true,
7167+ "default": "now()"
7168+ },
7169+ "updated_at": {
7170+ "name": "updated_at",
7171+ "type": "timestamp with time zone",
7172+ "primaryKey": false,
7173+ "notNull": true,
7174+ "default": "now()"
7175+ }
7176+ },
7177+ "indexes": {
7178+ "collections_user_idx": {
7179+ "name": "collections_user_idx",
7180+ "columns": [
7181+ {
7182+ "expression": "user_id",
7183+ "isExpression": false,
7184+ "asc": true,
7185+ "nulls": "last"
7186+ }
7187+ ],
7188+ "isUnique": false,
7189+ "concurrently": false,
7190+ "method": "btree",
7191+ "with": {}
7192+ },
7193+ "collections_public_slug_uq": {
7194+ "name": "collections_public_slug_uq",
7195+ "columns": [
7196+ {
7197+ "expression": "public_slug",
7198+ "isExpression": false,
7199+ "asc": true,
7200+ "nulls": "last"
7201+ }
7202+ ],
7203+ "isUnique": true,
7204+ "concurrently": false,
7205+ "method": "btree",
7206+ "with": {}
7207+ }
7208+ },
7209+ "foreignKeys": {},
7210+ "compositePrimaryKeys": {},
7211+ "uniqueConstraints": {},
7212+ "policies": {},
7213+ "checkConstraints": {},
7214+ "isRLSEnabled": false
7215+ },
7216+ "public.search_log": {
7217+ "name": "search_log",
7218+ "schema": "",
7219+ "columns": {
7220+ "id": {
7221+ "name": "id",
7222+ "type": "text",
7223+ "primaryKey": true,
7224+ "notNull": true
7225+ },
7226+ "query": {
7227+ "name": "query",
7228+ "type": "text",
7229+ "primaryKey": false,
7230+ "notNull": true
7231+ },
7232+ "normalized": {
7233+ "name": "normalized",
7234+ "type": "text",
7235+ "primaryKey": false,
7236+ "notNull": true
7237+ },
7238+ "results": {
7239+ "name": "results",
7240+ "type": "integer",
7241+ "primaryKey": false,
7242+ "notNull": true
7243+ },
7244+ "user_id": {
7245+ "name": "user_id",
7246+ "type": "text",
7247+ "primaryKey": false,
7248+ "notNull": false
7249+ },
7250+ "created_at": {
7251+ "name": "created_at",
7252+ "type": "timestamp with time zone",
7253+ "primaryKey": false,
7254+ "notNull": true,
7255+ "default": "now()"
7256+ }
7257+ },
7258+ "indexes": {
7259+ "search_log_created_idx": {
7260+ "name": "search_log_created_idx",
7261+ "columns": [
7262+ {
7263+ "expression": "created_at",
7264+ "isExpression": false,
7265+ "asc": true,
7266+ "nulls": "last"
7267+ }
7268+ ],
7269+ "isUnique": false,
7270+ "concurrently": false,
7271+ "method": "btree",
7272+ "with": {}
7273+ },
7274+ "search_log_normalized_idx": {
7275+ "name": "search_log_normalized_idx",
7276+ "columns": [
7277+ {
7278+ "expression": "normalized",
7279+ "isExpression": false,
7280+ "asc": true,
7281+ "nulls": "last"
7282+ }
7283+ ],
7284+ "isUnique": false,
7285+ "concurrently": false,
7286+ "method": "btree",
7287+ "with": {}
7288+ }
7289+ },
7290+ "foreignKeys": {},
7291+ "compositePrimaryKeys": {},
7292+ "uniqueConstraints": {},
7293+ "policies": {},
7294+ "checkConstraints": {},
7295+ "isRLSEnabled": false
7296+ },
7297+ "public.sessions": {
7298+ "name": "sessions",
7299+ "schema": "",
7300+ "columns": {
7301+ "id": {
7302+ "name": "id",
7303+ "type": "text",
7304+ "primaryKey": true,
7305+ "notNull": true
7306+ },
7307+ "user_id": {
7308+ "name": "user_id",
7309+ "type": "text",
7310+ "primaryKey": false,
7311+ "notNull": true
7312+ },
7313+ "expires_at": {
7314+ "name": "expires_at",
7315+ "type": "timestamp with time zone",
7316+ "primaryKey": false,
7317+ "notNull": true
7318+ },
7319+ "user_agent": {
7320+ "name": "user_agent",
7321+ "type": "text",
7322+ "primaryKey": false,
7323+ "notNull": false
7324+ },
7325+ "ip": {
7326+ "name": "ip",
7327+ "type": "text",
7328+ "primaryKey": false,
7329+ "notNull": false
7330+ },
7331+ "last_seen_at": {
7332+ "name": "last_seen_at",
7333+ "type": "timestamp with time zone",
7334+ "primaryKey": false,
7335+ "notNull": false
7336+ },
7337+ "revoked_at": {
7338+ "name": "revoked_at",
7339+ "type": "timestamp with time zone",
7340+ "primaryKey": false,
7341+ "notNull": false
7342+ },
7343+ "created_at": {
7344+ "name": "created_at",
7345+ "type": "timestamp with time zone",
7346+ "primaryKey": false,
7347+ "notNull": true,
7348+ "default": "now()"
7349+ }
7350+ },
7351+ "indexes": {
7352+ "sessions_user_idx": {
7353+ "name": "sessions_user_idx",
7354+ "columns": [
7355+ {
7356+ "expression": "user_id",
7357+ "isExpression": false,
7358+ "asc": true,
7359+ "nulls": "last"
7360+ }
7361+ ],
7362+ "isUnique": false,
7363+ "concurrently": false,
7364+ "method": "btree",
7365+ "with": {}
7366+ }
7367+ },
7368+ "foreignKeys": {},
7369+ "compositePrimaryKeys": {},
7370+ "uniqueConstraints": {},
7371+ "policies": {},
7372+ "checkConstraints": {},
7373+ "isRLSEnabled": false
7374+ },
7375+ "public.users": {
7376+ "name": "users",
7377+ "schema": "",
7378+ "columns": {
7379+ "id": {
7380+ "name": "id",
7381+ "type": "text",
7382+ "primaryKey": true,
7383+ "notNull": true
7384+ },
7385+ "email": {
7386+ "name": "email",
7387+ "type": "text",
7388+ "primaryKey": false,
7389+ "notNull": true
7390+ },
7391+ "email_verified_at": {
7392+ "name": "email_verified_at",
7393+ "type": "timestamp with time zone",
7394+ "primaryKey": false,
7395+ "notNull": false
7396+ },
7397+ "password_hash": {
7398+ "name": "password_hash",
7399+ "type": "text",
7400+ "primaryKey": false,
7401+ "notNull": false
7402+ },
7403+ "name": {
7404+ "name": "name",
7405+ "type": "text",
7406+ "primaryKey": false,
7407+ "notNull": false
7408+ },
7409+ "role": {
7410+ "name": "role",
7411+ "type": "text",
7412+ "primaryKey": false,
7413+ "notNull": true,
7414+ "default": "'user'"
7415+ },
7416+ "display_currency": {
7417+ "name": "display_currency",
7418+ "type": "text",
7419+ "primaryKey": false,
7420+ "notNull": true,
7421+ "default": "'USD'"
7422+ },
7423+ "providers": {
7424+ "name": "providers",
7425+ "type": "jsonb",
7426+ "primaryKey": false,
7427+ "notNull": true,
7428+ "default": "'[]'::jsonb"
7429+ },
7430+ "preferences": {
7431+ "name": "preferences",
7432+ "type": "jsonb",
7433+ "primaryKey": false,
7434+ "notNull": true,
7435+ "default": "'{}'::jsonb"
7436+ },
7437+ "handle": {
7438+ "name": "handle",
7439+ "type": "text",
7440+ "primaryKey": false,
7441+ "notNull": false
7442+ },
7443+ "avatar_url": {
7444+ "name": "avatar_url",
7445+ "type": "text",
7446+ "primaryKey": false,
7447+ "notNull": false
7448+ },
7449+ "bio": {
7450+ "name": "bio",
7451+ "type": "text",
7452+ "primaryKey": false,
7453+ "notNull": false
7454+ },
7455+ "mfa_enabled": {
7456+ "name": "mfa_enabled",
7457+ "type": "boolean",
7458+ "primaryKey": false,
7459+ "notNull": true,
7460+ "default": false
7461+ },
7462+ "totp_secret_enc": {
7463+ "name": "totp_secret_enc",
7464+ "type": "text",
7465+ "primaryKey": false,
7466+ "notNull": false
7467+ },
7468+ "always_ask_code": {
7469+ "name": "always_ask_code",
7470+ "type": "boolean",
7471+ "primaryKey": false,
7472+ "notNull": true,
7473+ "default": true
7474+ },
7475+ "password_changed_at": {
7476+ "name": "password_changed_at",
7477+ "type": "timestamp with time zone",
7478+ "primaryKey": false,
7479+ "notNull": false
7480+ },
7481+ "pending_email": {
7482+ "name": "pending_email",
7483+ "type": "text",
7484+ "primaryKey": false,
7485+ "notNull": false
7486+ },
7487+ "deleted_at": {
7488+ "name": "deleted_at",
7489+ "type": "timestamp with time zone",
7490+ "primaryKey": false,
7491+ "notNull": false
7492+ },
7493+ "purge_after": {
7494+ "name": "purge_after",
7495+ "type": "timestamp with time zone",
7496+ "primaryKey": false,
7497+ "notNull": false
7498+ },
7499+ "created_at": {
7500+ "name": "created_at",
7501+ "type": "timestamp with time zone",
7502+ "primaryKey": false,
7503+ "notNull": true,
7504+ "default": "now()"
7505+ },
7506+ "last_login_at": {
7507+ "name": "last_login_at",
7508+ "type": "timestamp with time zone",
7509+ "primaryKey": false,
7510+ "notNull": false
7511+ }
7512+ },
7513+ "indexes": {},
7514+ "foreignKeys": {},
7515+ "compositePrimaryKeys": {},
7516+ "uniqueConstraints": {
7517+ "users_email_unique": {
7518+ "name": "users_email_unique",
7519+ "nullsNotDistinct": false,
7520+ "columns": [
7521+ "email"
7522+ ]
7523+ },
7524+ "users_handle_unique": {
7525+ "name": "users_handle_unique",
7526+ "nullsNotDistinct": false,
7527+ "columns": [
7528+ "handle"
7529+ ]
7530+ }
7531+ },
7532+ "policies": {},
7533+ "checkConstraints": {},
7534+ "isRLSEnabled": false
7535+ },
7536+ "public.watchlist_items": {
7537+ "name": "watchlist_items",
7538+ "schema": "",
7539+ "columns": {
7540+ "id": {
7541+ "name": "id",
7542+ "type": "text",
7543+ "primaryKey": true,
7544+ "notNull": true
7545+ },
7546+ "watchlist_id": {
7547+ "name": "watchlist_id",
7548+ "type": "text",
7549+ "primaryKey": false,
7550+ "notNull": true
7551+ },
7552+ "target_type": {
7553+ "name": "target_type",
7554+ "type": "text",
7555+ "primaryKey": false,
7556+ "notNull": true
7557+ },
7558+ "target_id": {
7559+ "name": "target_id",
7560+ "type": "text",
7561+ "primaryKey": false,
7562+ "notNull": true
7563+ },
7564+ "label": {
7565+ "name": "label",
7566+ "type": "text",
7567+ "primaryKey": false,
7568+ "notNull": false
7569+ },
7570+ "note": {
7571+ "name": "note",
7572+ "type": "text",
7573+ "primaryKey": false,
7574+ "notNull": false
7575+ },
7576+ "target_price_usd": {
7577+ "name": "target_price_usd",
7578+ "type": "numeric(18, 4)",
7579+ "primaryKey": false,
7580+ "notNull": false
7581+ },
7582+ "baseline_usd": {
7583+ "name": "baseline_usd",
7584+ "type": "numeric(18, 4)",
7585+ "primaryKey": false,
7586+ "notNull": false
7587+ },
7588+ "created_at": {
7589+ "name": "created_at",
7590+ "type": "timestamp with time zone",
7591+ "primaryKey": false,
7592+ "notNull": true,
7593+ "default": "now()"
7594+ }
7595+ },
7596+ "indexes": {
7597+ "watchlist_items_uq": {
7598+ "name": "watchlist_items_uq",
7599+ "columns": [
7600+ {
7601+ "expression": "watchlist_id",
7602+ "isExpression": false,
7603+ "asc": true,
7604+ "nulls": "last"
7605+ },
7606+ {
7607+ "expression": "target_type",
7608+ "isExpression": false,
7609+ "asc": true,
7610+ "nulls": "last"
7611+ },
7612+ {
7613+ "expression": "target_id",
7614+ "isExpression": false,
7615+ "asc": true,
7616+ "nulls": "last"
7617+ }
7618+ ],
7619+ "isUnique": true,
7620+ "concurrently": false,
7621+ "method": "btree",
7622+ "with": {}
7623+ }
7624+ },
7625+ "foreignKeys": {},
7626+ "compositePrimaryKeys": {},
7627+ "uniqueConstraints": {},
7628+ "policies": {},
7629+ "checkConstraints": {},
7630+ "isRLSEnabled": false
7631+ },
7632+ "public.watchlists": {
7633+ "name": "watchlists",
7634+ "schema": "",
7635+ "columns": {
7636+ "id": {
7637+ "name": "id",
7638+ "type": "text",
7639+ "primaryKey": true,
7640+ "notNull": true
7641+ },
7642+ "user_id": {
7643+ "name": "user_id",
7644+ "type": "text",
7645+ "primaryKey": false,
7646+ "notNull": true
7647+ },
7648+ "name": {
7649+ "name": "name",
7650+ "type": "text",
7651+ "primaryKey": false,
7652+ "notNull": true,
7653+ "default": "'Watchlist'"
7654+ },
7655+ "created_at": {
7656+ "name": "created_at",
7657+ "type": "timestamp with time zone",
7658+ "primaryKey": false,
7659+ "notNull": true,
7660+ "default": "now()"
7661+ }
7662+ },
7663+ "indexes": {
7664+ "watchlists_user_idx": {
7665+ "name": "watchlists_user_idx",
7666+ "columns": [
7667+ {
7668+ "expression": "user_id",
7669+ "isExpression": false,
7670+ "asc": true,
7671+ "nulls": "last"
7672+ }
7673+ ],
7674+ "isUnique": false,
7675+ "concurrently": false,
7676+ "method": "btree",
7677+ "with": {}
7678+ }
7679+ },
7680+ "foreignKeys": {},
7681+ "compositePrimaryKeys": {},
7682+ "uniqueConstraints": {},
7683+ "policies": {},
7684+ "checkConstraints": {},
7685+ "isRLSEnabled": false
7686+ },
7687+ "public.ai_quotas": {
7688+ "name": "ai_quotas",
7689+ "schema": "",
7690+ "columns": {
7691+ "key": {
7692+ "name": "key",
7693+ "type": "text",
7694+ "primaryKey": false,
7695+ "notNull": true
7696+ },
7697+ "feature": {
7698+ "name": "feature",
7699+ "type": "text",
7700+ "primaryKey": false,
7701+ "notNull": true
7702+ },
7703+ "date": {
7704+ "name": "date",
7705+ "type": "text",
7706+ "primaryKey": false,
7707+ "notNull": true
7708+ },
7709+ "count": {
7710+ "name": "count",
7711+ "type": "integer",
7712+ "primaryKey": false,
7713+ "notNull": true,
7714+ "default": 0
7715+ }
7716+ },
7717+ "indexes": {
7718+ "ai_quotas_uq": {
7719+ "name": "ai_quotas_uq",
7720+ "columns": [
7721+ {
7722+ "expression": "key",
7723+ "isExpression": false,
7724+ "asc": true,
7725+ "nulls": "last"
7726+ },
7727+ {
7728+ "expression": "feature",
7729+ "isExpression": false,
7730+ "asc": true,
7731+ "nulls": "last"
7732+ },
7733+ {
7734+ "expression": "date",
7735+ "isExpression": false,
7736+ "asc": true,
7737+ "nulls": "last"
7738+ }
7739+ ],
7740+ "isUnique": true,
7741+ "concurrently": false,
7742+ "method": "btree",
7743+ "with": {}
7744+ }
7745+ },
7746+ "foreignKeys": {},
7747+ "compositePrimaryKeys": {},
7748+ "uniqueConstraints": {},
7749+ "policies": {},
7750+ "checkConstraints": {},
7751+ "isRLSEnabled": false
7752+ },
7753+ "public.research_messages": {
7754+ "name": "research_messages",
7755+ "schema": "",
7756+ "columns": {
7757+ "id": {
7758+ "name": "id",
7759+ "type": "text",
7760+ "primaryKey": true,
7761+ "notNull": true
7762+ },
7763+ "session_id": {
7764+ "name": "session_id",
7765+ "type": "text",
7766+ "primaryKey": false,
7767+ "notNull": true
7768+ },
7769+ "role": {
7770+ "name": "role",
7771+ "type": "text",
7772+ "primaryKey": false,
7773+ "notNull": true
7774+ },
7775+ "content": {
7776+ "name": "content",
7777+ "type": "text",
7778+ "primaryKey": false,
7779+ "notNull": true
7780+ },
7781+ "tool_calls": {
7782+ "name": "tool_calls",
7783+ "type": "jsonb",
7784+ "primaryKey": false,
7785+ "notNull": true,
7786+ "default": "'[]'::jsonb"
7787+ },
7788+ "usage": {
7789+ "name": "usage",
7790+ "type": "jsonb",
7791+ "primaryKey": false,
7792+ "notNull": true,
7793+ "default": "'{}'::jsonb"
7794+ },
7795+ "usd_est": {
7796+ "name": "usd_est",
7797+ "type": "real",
7798+ "primaryKey": false,
7799+ "notNull": true,
7800+ "default": 0
7801+ },
7802+ "model": {
7803+ "name": "model",
7804+ "type": "text",
7805+ "primaryKey": false,
7806+ "notNull": false
7807+ },
7808+ "created_at": {
7809+ "name": "created_at",
7810+ "type": "timestamp with time zone",
7811+ "primaryKey": false,
7812+ "notNull": true,
7813+ "default": "now()"
7814+ }
7815+ },
7816+ "indexes": {
7817+ "research_messages_session_idx": {
7818+ "name": "research_messages_session_idx",
7819+ "columns": [
7820+ {
7821+ "expression": "session_id",
7822+ "isExpression": false,
7823+ "asc": true,
7824+ "nulls": "last"
7825+ },
7826+ {
7827+ "expression": "created_at",
7828+ "isExpression": false,
7829+ "asc": true,
7830+ "nulls": "last"
7831+ }
7832+ ],
7833+ "isUnique": false,
7834+ "concurrently": false,
7835+ "method": "btree",
7836+ "with": {}
7837+ }
7838+ },
7839+ "foreignKeys": {},
7840+ "compositePrimaryKeys": {},
7841+ "uniqueConstraints": {},
7842+ "policies": {},
7843+ "checkConstraints": {},
7844+ "isRLSEnabled": false
7845+ },
7846+ "public.research_sessions": {
7847+ "name": "research_sessions",
7848+ "schema": "",
7849+ "columns": {
7850+ "id": {
7851+ "name": "id",
7852+ "type": "text",
7853+ "primaryKey": true,
7854+ "notNull": true
7855+ },
7856+ "user_id": {
7857+ "name": "user_id",
7858+ "type": "text",
7859+ "primaryKey": false,
7860+ "notNull": false
7861+ },
7862+ "anon_id": {
7863+ "name": "anon_id",
7864+ "type": "text",
7865+ "primaryKey": false,
7866+ "notNull": false
7867+ },
7868+ "title": {
7869+ "name": "title",
7870+ "type": "text",
7871+ "primaryKey": false,
7872+ "notNull": false
7873+ },
7874+ "model": {
7875+ "name": "model",
7876+ "type": "text",
7877+ "primaryKey": false,
7878+ "notNull": false
7879+ },
7880+ "message_count": {
7881+ "name": "message_count",
7882+ "type": "integer",
7883+ "primaryKey": false,
7884+ "notNull": true,
7885+ "default": 0
7886+ },
7887+ "usd_est": {
7888+ "name": "usd_est",
7889+ "type": "real",
7890+ "primaryKey": false,
7891+ "notNull": true,
7892+ "default": 0
7893+ },
7894+ "archived": {
7895+ "name": "archived",
7896+ "type": "boolean",
7897+ "primaryKey": false,
7898+ "notNull": true,
7899+ "default": false
7900+ },
7901+ "created_at": {
7902+ "name": "created_at",
7903+ "type": "timestamp with time zone",
7904+ "primaryKey": false,
7905+ "notNull": true,
7906+ "default": "now()"
7907+ },
7908+ "updated_at": {
7909+ "name": "updated_at",
7910+ "type": "timestamp with time zone",
7911+ "primaryKey": false,
7912+ "notNull": true,
7913+ "default": "now()"
7914+ }
7915+ },
7916+ "indexes": {
7917+ "research_sessions_anon_idx": {
7918+ "name": "research_sessions_anon_idx",
7919+ "columns": [
7920+ {
7921+ "expression": "anon_id",
7922+ "isExpression": false,
7923+ "asc": true,
7924+ "nulls": "last"
7925+ },
7926+ {
7927+ "expression": "updated_at",
7928+ "isExpression": false,
7929+ "asc": true,
7930+ "nulls": "last"
7931+ }
7932+ ],
7933+ "isUnique": false,
7934+ "concurrently": false,
7935+ "method": "btree",
7936+ "with": {}
7937+ },
7938+ "research_sessions_user_idx": {
7939+ "name": "research_sessions_user_idx",
7940+ "columns": [
7941+ {
7942+ "expression": "user_id",
7943+ "isExpression": false,
7944+ "asc": true,
7945+ "nulls": "last"
7946+ },
7947+ {
7948+ "expression": "updated_at",
7949+ "isExpression": false,
7950+ "asc": true,
7951+ "nulls": "last"
7952+ }
7953+ ],
7954+ "isUnique": false,
7955+ "concurrently": false,
7956+ "method": "btree",
7957+ "with": {}
7958+ }
7959+ },
7960+ "foreignKeys": {},
7961+ "compositePrimaryKeys": {},
7962+ "uniqueConstraints": {},
7963+ "policies": {},
7964+ "checkConstraints": {},
7965+ "isRLSEnabled": false
7966+ },
7967+ "public.scanner_sessions": {
7968+ "name": "scanner_sessions",
7969+ "schema": "",
7970+ "columns": {
7971+ "id": {
7972+ "name": "id",
7973+ "type": "text",
7974+ "primaryKey": true,
7975+ "notNull": true
7976+ },
7977+ "user_id": {
7978+ "name": "user_id",
7979+ "type": "text",
7980+ "primaryKey": false,
7981+ "notNull": false
7982+ },
7983+ "anon_id": {
7984+ "name": "anon_id",
7985+ "type": "text",
7986+ "primaryKey": false,
7987+ "notNull": false
7988+ },
7989+ "ip_hash": {
7990+ "name": "ip_hash",
7991+ "type": "text",
7992+ "primaryKey": false,
7993+ "notNull": false
7994+ },
7995+ "mode": {
7996+ "name": "mode",
7997+ "type": "text",
7998+ "primaryKey": false,
7999+ "notNull": true
8000+ },
8001+ "input_url": {
8002+ "name": "input_url",
8003+ "type": "text",
8004+ "primaryKey": false,
8005+ "notNull": false
8006+ },
8007+ "input_text": {
8008+ "name": "input_text",
8009+ "type": "text",
8010+ "primaryKey": false,
8011+ "notNull": false
8012+ },
8013+ "image_count": {
8014+ "name": "image_count",
8015+ "type": "integer",
8016+ "primaryKey": false,
8017+ "notNull": true,
8018+ "default": 0
8019+ },
8020+ "thumbnails": {
8021+ "name": "thumbnails",
8022+ "type": "jsonb",
8023+ "primaryKey": false,
8024+ "notNull": true,
8025+ "default": "'[]'::jsonb"
8026+ },
8027+ "guess": {
8028+ "name": "guess",
8029+ "type": "jsonb",
8030+ "primaryKey": false,
8031+ "notNull": true,
8032+ "default": "'{}'::jsonb"
8033+ },
8034+ "guess_confidence": {
8035+ "name": "guess_confidence",
8036+ "type": "real",
8037+ "primaryKey": false,
8038+ "notNull": false
8039+ },
8040+ "candidates": {
8041+ "name": "candidates",
8042+ "type": "jsonb",
8043+ "primaryKey": false,
8044+ "notNull": true,
8045+ "default": "'[]'::jsonb"
8046+ },
8047+ "chosen_asset_id": {
8048+ "name": "chosen_asset_id",
8049+ "type": "text",
8050+ "primaryKey": false,
8051+ "notNull": false
8052+ },
8053+ "listing": {
8054+ "name": "listing",
8055+ "type": "jsonb",
8056+ "primaryKey": false,
8057+ "notNull": true,
8058+ "default": "'{}'::jsonb"
8059+ },
8060+ "model": {
8061+ "name": "model",
8062+ "type": "text",
8063+ "primaryKey": false,
8064+ "notNull": false
8065+ },
8066+ "usd_est": {
8067+ "name": "usd_est",
8068+ "type": "real",
8069+ "primaryKey": false,
8070+ "notNull": true,
8071+ "default": 0
8072+ },
8073+ "duration_ms": {
8074+ "name": "duration_ms",
8075+ "type": "integer",
8076+ "primaryKey": false,
8077+ "notNull": false
8078+ },
8079+ "error": {
8080+ "name": "error",
8081+ "type": "text",
8082+ "primaryKey": false,
8083+ "notNull": false
8084+ },
8085+ "created_at": {
8086+ "name": "created_at",
8087+ "type": "timestamp with time zone",
8088+ "primaryKey": false,
8089+ "notNull": true,
8090+ "default": "now()"
8091+ },
8092+ "chosen_at": {
8093+ "name": "chosen_at",
8094+ "type": "timestamp with time zone",
8095+ "primaryKey": false,
8096+ "notNull": false
8097+ }
8098+ },
8099+ "indexes": {
8100+ "scanner_sessions_created_idx": {
8101+ "name": "scanner_sessions_created_idx",
8102+ "columns": [
8103+ {
8104+ "expression": "created_at",
8105+ "isExpression": false,
8106+ "asc": true,
8107+ "nulls": "last"
8108+ }
8109+ ],
8110+ "isUnique": false,
8111+ "concurrently": false,
8112+ "method": "btree",
8113+ "with": {}
8114+ },
8115+ "scanner_sessions_ip_idx": {
8116+ "name": "scanner_sessions_ip_idx",
8117+ "columns": [
8118+ {
8119+ "expression": "ip_hash",
8120+ "isExpression": false,
8121+ "asc": true,
8122+ "nulls": "last"
8123+ },
8124+ {
8125+ "expression": "created_at",
8126+ "isExpression": false,
8127+ "asc": true,
8128+ "nulls": "last"
8129+ }
8130+ ],
8131+ "isUnique": false,
8132+ "concurrently": false,
8133+ "method": "btree",
8134+ "with": {}
8135+ },
8136+ "scanner_sessions_user_idx": {
8137+ "name": "scanner_sessions_user_idx",
8138+ "columns": [
8139+ {
8140+ "expression": "user_id",
8141+ "isExpression": false,
8142+ "asc": true,
8143+ "nulls": "last"
8144+ }
8145+ ],
8146+ "isUnique": false,
8147+ "concurrently": false,
8148+ "method": "btree",
8149+ "with": {}
8150+ }
8151+ },
8152+ "foreignKeys": {},
8153+ "compositePrimaryKeys": {},
8154+ "uniqueConstraints": {},
8155+ "policies": {},
8156+ "checkConstraints": {},
8157+ "isRLSEnabled": false
8158+ },
8159+ "public.auth_codes": {
8160+ "name": "auth_codes",
8161+ "schema": "",
8162+ "columns": {
8163+ "id": {
8164+ "name": "id",
8165+ "type": "text",
8166+ "primaryKey": true,
8167+ "notNull": true
8168+ },
8169+ "user_id": {
8170+ "name": "user_id",
8171+ "type": "text",
8172+ "primaryKey": false,
8173+ "notNull": false
8174+ },
8175+ "email": {
8176+ "name": "email",
8177+ "type": "text",
8178+ "primaryKey": false,
8179+ "notNull": true
8180+ },
8181+ "purpose": {
8182+ "name": "purpose",
8183+ "type": "text",
8184+ "primaryKey": false,
8185+ "notNull": true
8186+ },
8187+ "code_hash": {
8188+ "name": "code_hash",
8189+ "type": "text",
8190+ "primaryKey": false,
8191+ "notNull": true
8192+ },
8193+ "expires_at": {
8194+ "name": "expires_at",
8195+ "type": "timestamp with time zone",
8196+ "primaryKey": false,
8197+ "notNull": true
8198+ },
8199+ "attempts": {
8200+ "name": "attempts",
8201+ "type": "integer",
8202+ "primaryKey": false,
8203+ "notNull": true,
8204+ "default": 0
8205+ },
8206+ "consumed_at": {
8207+ "name": "consumed_at",
8208+ "type": "timestamp with time zone",
8209+ "primaryKey": false,
8210+ "notNull": false
8211+ },
8212+ "payload": {
8213+ "name": "payload",
8214+ "type": "jsonb",
8215+ "primaryKey": false,
8216+ "notNull": true,
8217+ "default": "'{}'::jsonb"
8218+ },
8219+ "created_at": {
8220+ "name": "created_at",
8221+ "type": "timestamp with time zone",
8222+ "primaryKey": false,
8223+ "notNull": true,
8224+ "default": "now()"
8225+ }
8226+ },
8227+ "indexes": {
8228+ "auth_codes_lookup_idx": {
8229+ "name": "auth_codes_lookup_idx",
8230+ "columns": [
8231+ {
8232+ "expression": "email",
8233+ "isExpression": false,
8234+ "asc": true,
8235+ "nulls": "last"
8236+ },
8237+ {
8238+ "expression": "purpose",
8239+ "isExpression": false,
8240+ "asc": true,
8241+ "nulls": "last"
8242+ },
8243+ {
8244+ "expression": "created_at",
8245+ "isExpression": false,
8246+ "asc": true,
8247+ "nulls": "last"
8248+ }
8249+ ],
8250+ "isUnique": false,
8251+ "concurrently": false,
8252+ "method": "btree",
8253+ "with": {}
8254+ }
8255+ },
8256+ "foreignKeys": {},
8257+ "compositePrimaryKeys": {},
8258+ "uniqueConstraints": {},
8259+ "policies": {},
8260+ "checkConstraints": {},
8261+ "isRLSEnabled": false
8262+ },
8263+ "public.login_events": {
8264+ "name": "login_events",
8265+ "schema": "",
8266+ "columns": {
8267+ "id": {
8268+ "name": "id",
8269+ "type": "text",
8270+ "primaryKey": true,
8271+ "notNull": true
8272+ },
8273+ "user_id": {
8274+ "name": "user_id",
8275+ "type": "text",
8276+ "primaryKey": false,
8277+ "notNull": false
8278+ },
8279+ "email": {
8280+ "name": "email",
8281+ "type": "text",
8282+ "primaryKey": false,
8283+ "notNull": false
8284+ },
8285+ "ip": {
8286+ "name": "ip",
8287+ "type": "text",
8288+ "primaryKey": false,
8289+ "notNull": false
8290+ },
8291+ "user_agent": {
8292+ "name": "user_agent",
8293+ "type": "text",
8294+ "primaryKey": false,
8295+ "notNull": false
8296+ },
8297+ "outcome": {
8298+ "name": "outcome",
8299+ "type": "text",
8300+ "primaryKey": false,
8301+ "notNull": true
8302+ },
8303+ "method": {
8304+ "name": "method",
8305+ "type": "text",
8306+ "primaryKey": false,
8307+ "notNull": false
8308+ },
8309+ "created_at": {
8310+ "name": "created_at",
8311+ "type": "timestamp with time zone",
8312+ "primaryKey": false,
8313+ "notNull": true,
8314+ "default": "now()"
8315+ }
8316+ },
8317+ "indexes": {
8318+ "login_events_user_idx": {
8319+ "name": "login_events_user_idx",
8320+ "columns": [
8321+ {
8322+ "expression": "user_id",
8323+ "isExpression": false,
8324+ "asc": true,
8325+ "nulls": "last"
8326+ },
8327+ {
8328+ "expression": "created_at",
8329+ "isExpression": false,
8330+ "asc": true,
8331+ "nulls": "last"
8332+ }
8333+ ],
8334+ "isUnique": false,
8335+ "concurrently": false,
8336+ "method": "btree",
8337+ "with": {}
8338+ }
8339+ },
8340+ "foreignKeys": {},
8341+ "compositePrimaryKeys": {},
8342+ "uniqueConstraints": {},
8343+ "policies": {},
8344+ "checkConstraints": {},
8345+ "isRLSEnabled": false
8346+ },
8347+ "public.notifications": {
8348+ "name": "notifications",
8349+ "schema": "",
8350+ "columns": {
8351+ "id": {
8352+ "name": "id",
8353+ "type": "text",
8354+ "primaryKey": true,
8355+ "notNull": true
8356+ },
8357+ "user_id": {
8358+ "name": "user_id",
8359+ "type": "text",
8360+ "primaryKey": false,
8361+ "notNull": true
8362+ },
8363+ "kind": {
8364+ "name": "kind",
8365+ "type": "text",
8366+ "primaryKey": false,
8367+ "notNull": true
8368+ },
8369+ "title": {
8370+ "name": "title",
8371+ "type": "text",
8372+ "primaryKey": false,
8373+ "notNull": true
8374+ },
8375+ "body": {
8376+ "name": "body",
8377+ "type": "text",
8378+ "primaryKey": false,
8379+ "notNull": false
8380+ },
8381+ "href": {
8382+ "name": "href",
8383+ "type": "text",
8384+ "primaryKey": false,
8385+ "notNull": false
8386+ },
8387+ "payload": {
8388+ "name": "payload",
8389+ "type": "jsonb",
8390+ "primaryKey": false,
8391+ "notNull": true,
8392+ "default": "'{}'::jsonb"
8393+ },
8394+ "read_at": {
8395+ "name": "read_at",
8396+ "type": "timestamp with time zone",
8397+ "primaryKey": false,
8398+ "notNull": false
8399+ },
8400+ "emailed_at": {
8401+ "name": "emailed_at",
8402+ "type": "timestamp with time zone",
8403+ "primaryKey": false,
8404+ "notNull": false
8405+ },
8406+ "created_at": {
8407+ "name": "created_at",
8408+ "type": "timestamp with time zone",
8409+ "primaryKey": false,
8410+ "notNull": true,
8411+ "default": "now()"
8412+ }
8413+ },
8414+ "indexes": {
8415+ "notifications_user_idx": {
8416+ "name": "notifications_user_idx",
8417+ "columns": [
8418+ {
8419+ "expression": "user_id",
8420+ "isExpression": false,
8421+ "asc": true,
8422+ "nulls": "last"
8423+ },
8424+ {
8425+ "expression": "created_at",
8426+ "isExpression": false,
8427+ "asc": true,
8428+ "nulls": "last"
8429+ }
8430+ ],
8431+ "isUnique": false,
8432+ "concurrently": false,
8433+ "method": "btree",
8434+ "with": {}
8435+ },
8436+ "notifications_unread_idx": {
8437+ "name": "notifications_unread_idx",
8438+ "columns": [
8439+ {
8440+ "expression": "user_id",
8441+ "isExpression": false,
8442+ "asc": true,
8443+ "nulls": "last"
8444+ },
8445+ {
8446+ "expression": "read_at",
8447+ "isExpression": false,
8448+ "asc": true,
8449+ "nulls": "last"
8450+ }
8451+ ],
8452+ "isUnique": false,
8453+ "concurrently": false,
8454+ "method": "btree",
8455+ "with": {}
8456+ }
8457+ },
8458+ "foreignKeys": {},
8459+ "compositePrimaryKeys": {},
8460+ "uniqueConstraints": {},
8461+ "policies": {},
8462+ "checkConstraints": {},
8463+ "isRLSEnabled": false
8464+ },
8465+ "public.price_targets": {
8466+ "name": "price_targets",
8467+ "schema": "",
8468+ "columns": {
8469+ "id": {
8470+ "name": "id",
8471+ "type": "text",
8472+ "primaryKey": true,
8473+ "notNull": true
8474+ },
8475+ "user_id": {
8476+ "name": "user_id",
8477+ "type": "text",
8478+ "primaryKey": false,
8479+ "notNull": true
8480+ },
8481+ "asset_id": {
8482+ "name": "asset_id",
8483+ "type": "text",
8484+ "primaryKey": false,
8485+ "notNull": true
8486+ },
8487+ "variant_id": {
8488+ "name": "variant_id",
8489+ "type": "text",
8490+ "primaryKey": false,
8491+ "notNull": false
8492+ },
8493+ "direction": {
8494+ "name": "direction",
8495+ "type": "text",
8496+ "primaryKey": false,
8497+ "notNull": true,
8498+ "default": "'above'"
8499+ },
8500+ "target_usd": {
8501+ "name": "target_usd",
8502+ "type": "numeric(18, 4)",
8503+ "primaryKey": false,
8504+ "notNull": true
8505+ },
8506+ "baseline_usd": {
8507+ "name": "baseline_usd",
8508+ "type": "numeric(18, 4)",
8509+ "primaryKey": false,
8510+ "notNull": false
8511+ },
8512+ "note": {
8513+ "name": "note",
8514+ "type": "text",
8515+ "primaryKey": false,
8516+ "notNull": false
8517+ },
8518+ "hit_at": {
8519+ "name": "hit_at",
8520+ "type": "timestamp with time zone",
8521+ "primaryKey": false,
8522+ "notNull": false
8523+ },
8524+ "notified_at": {
8525+ "name": "notified_at",
8526+ "type": "timestamp with time zone",
8527+ "primaryKey": false,
8528+ "notNull": false
8529+ },
8530+ "created_at": {
8531+ "name": "created_at",
8532+ "type": "timestamp with time zone",
8533+ "primaryKey": false,
8534+ "notNull": true,
8535+ "default": "now()"
8536+ }
8537+ },
8538+ "indexes": {
8539+ "price_targets_user_idx": {
8540+ "name": "price_targets_user_idx",
8541+ "columns": [
8542+ {
8543+ "expression": "user_id",
8544+ "isExpression": false,
8545+ "asc": true,
8546+ "nulls": "last"
8547+ }
8548+ ],
8549+ "isUnique": false,
8550+ "concurrently": false,
8551+ "method": "btree",
8552+ "with": {}
8553+ },
8554+ "price_targets_asset_idx": {
8555+ "name": "price_targets_asset_idx",
8556+ "columns": [
8557+ {
8558+ "expression": "asset_id",
8559+ "isExpression": false,
8560+ "asc": true,
8561+ "nulls": "last"
8562+ },
8563+ {
8564+ "expression": "hit_at",
8565+ "isExpression": false,
8566+ "asc": true,
8567+ "nulls": "last"
8568+ }
8569+ ],
8570+ "isUnique": false,
8571+ "concurrently": false,
8572+ "method": "btree",
8573+ "with": {}
8574+ }
8575+ },
8576+ "foreignKeys": {},
8577+ "compositePrimaryKeys": {},
8578+ "uniqueConstraints": {},
8579+ "policies": {},
8580+ "checkConstraints": {},
8581+ "isRLSEnabled": false
8582+ },
8583+ "public.rate_limits": {
8584+ "name": "rate_limits",
8585+ "schema": "",
8586+ "columns": {
8587+ "key": {
8588+ "name": "key",
8589+ "type": "text",
8590+ "primaryKey": true,
8591+ "notNull": true
8592+ },
8593+ "count": {
8594+ "name": "count",
8595+ "type": "integer",
8596+ "primaryKey": false,
8597+ "notNull": true,
8598+ "default": 0
8599+ },
8600+ "reset_at": {
8601+ "name": "reset_at",
8602+ "type": "timestamp with time zone",
8603+ "primaryKey": false,
8604+ "notNull": true
8605+ }
8606+ },
8607+ "indexes": {},
8608+ "foreignKeys": {},
8609+ "compositePrimaryKeys": {},
8610+ "uniqueConstraints": {},
8611+ "policies": {},
8612+ "checkConstraints": {},
8613+ "isRLSEnabled": false
8614+ },
8615+ "public.recovery_codes": {
8616+ "name": "recovery_codes",
8617+ "schema": "",
8618+ "columns": {
8619+ "id": {
8620+ "name": "id",
8621+ "type": "text",
8622+ "primaryKey": true,
8623+ "notNull": true
8624+ },
8625+ "user_id": {
8626+ "name": "user_id",
8627+ "type": "text",
8628+ "primaryKey": false,
8629+ "notNull": true
8630+ },
8631+ "code_hash": {
8632+ "name": "code_hash",
8633+ "type": "text",
8634+ "primaryKey": false,
8635+ "notNull": true
8636+ },
8637+ "used_at": {
8638+ "name": "used_at",
8639+ "type": "timestamp with time zone",
8640+ "primaryKey": false,
8641+ "notNull": false
8642+ },
8643+ "created_at": {
8644+ "name": "created_at",
8645+ "type": "timestamp with time zone",
8646+ "primaryKey": false,
8647+ "notNull": true,
8648+ "default": "now()"
8649+ }
8650+ },
8651+ "indexes": {
8652+ "recovery_codes_user_idx": {
8653+ "name": "recovery_codes_user_idx",
8654+ "columns": [
8655+ {
8656+ "expression": "user_id",
8657+ "isExpression": false,
8658+ "asc": true,
8659+ "nulls": "last"
8660+ }
8661+ ],
8662+ "isUnique": false,
8663+ "concurrently": false,
8664+ "method": "btree",
8665+ "with": {}
8666+ }
8667+ },
8668+ "foreignKeys": {},
8669+ "compositePrimaryKeys": {},
8670+ "uniqueConstraints": {},
8671+ "policies": {},
8672+ "checkConstraints": {},
8673+ "isRLSEnabled": false
8674+ },
8675+ "public.saved_searches": {
8676+ "name": "saved_searches",
8677+ "schema": "",
8678+ "columns": {
8679+ "id": {
8680+ "name": "id",
8681+ "type": "text",
8682+ "primaryKey": true,
8683+ "notNull": true
8684+ },
8685+ "user_id": {
8686+ "name": "user_id",
8687+ "type": "text",
8688+ "primaryKey": false,
8689+ "notNull": true
8690+ },
8691+ "name": {
8692+ "name": "name",
8693+ "type": "text",
8694+ "primaryKey": false,
8695+ "notNull": true
8696+ },
8697+ "url": {
8698+ "name": "url",
8699+ "type": "text",
8700+ "primaryKey": false,
8701+ "notNull": true
8702+ },
8703+ "params": {
8704+ "name": "params",
8705+ "type": "jsonb",
8706+ "primaryKey": false,
8707+ "notNull": true,
8708+ "default": "'{}'::jsonb"
8709+ },
8710+ "notify": {
8711+ "name": "notify",
8712+ "type": "boolean",
8713+ "primaryKey": false,
8714+ "notNull": true,
8715+ "default": false
8716+ },
8717+ "last_run_at": {
8718+ "name": "last_run_at",
8719+ "type": "timestamp with time zone",
8720+ "primaryKey": false,
8721+ "notNull": false
8722+ },
8723+ "last_count": {
8724+ "name": "last_count",
8725+ "type": "integer",
8726+ "primaryKey": false,
8727+ "notNull": false
8728+ },
8729+ "created_at": {
8730+ "name": "created_at",
8731+ "type": "timestamp with time zone",
8732+ "primaryKey": false,
8733+ "notNull": true,
8734+ "default": "now()"
8735+ }
8736+ },
8737+ "indexes": {
8738+ "saved_searches_user_idx": {
8739+ "name": "saved_searches_user_idx",
8740+ "columns": [
8741+ {
8742+ "expression": "user_id",
8743+ "isExpression": false,
8744+ "asc": true,
8745+ "nulls": "last"
8746+ }
8747+ ],
8748+ "isUnique": false,
8749+ "concurrently": false,
8750+ "method": "btree",
8751+ "with": {}
8752+ }
8753+ },
8754+ "foreignKeys": {},
8755+ "compositePrimaryKeys": {},
8756+ "uniqueConstraints": {},
8757+ "policies": {},
8758+ "checkConstraints": {},
8759+ "isRLSEnabled": false
8760+ },
8761+ "public.trusted_devices": {
8762+ "name": "trusted_devices",
8763+ "schema": "",
8764+ "columns": {
8765+ "id": {
8766+ "name": "id",
8767+ "type": "text",
8768+ "primaryKey": true,
8769+ "notNull": true
8770+ },
8771+ "user_id": {
8772+ "name": "user_id",
8773+ "type": "text",
8774+ "primaryKey": false,
8775+ "notNull": true
8776+ },
8777+ "token_hash": {
8778+ "name": "token_hash",
8779+ "type": "text",
8780+ "primaryKey": false,
8781+ "notNull": true
8782+ },
8783+ "label": {
8784+ "name": "label",
8785+ "type": "text",
8786+ "primaryKey": false,
8787+ "notNull": false
8788+ },
8789+ "user_agent": {
8790+ "name": "user_agent",
8791+ "type": "text",
8792+ "primaryKey": false,
8793+ "notNull": false
8794+ },
8795+ "ip": {
8796+ "name": "ip",
8797+ "type": "text",
8798+ "primaryKey": false,
8799+ "notNull": false
8800+ },
8801+ "created_at": {
8802+ "name": "created_at",
8803+ "type": "timestamp with time zone",
8804+ "primaryKey": false,
8805+ "notNull": true,
8806+ "default": "now()"
8807+ },
8808+ "last_used_at": {
8809+ "name": "last_used_at",
8810+ "type": "timestamp with time zone",
8811+ "primaryKey": false,
8812+ "notNull": false
8813+ },
8814+ "expires_at": {
8815+ "name": "expires_at",
8816+ "type": "timestamp with time zone",
8817+ "primaryKey": false,
8818+ "notNull": true
8819+ },
8820+ "revoked_at": {
8821+ "name": "revoked_at",
8822+ "type": "timestamp with time zone",
8823+ "primaryKey": false,
8824+ "notNull": false
8825+ }
8826+ },
8827+ "indexes": {
8828+ "trusted_devices_user_idx": {
8829+ "name": "trusted_devices_user_idx",
8830+ "columns": [
8831+ {
8832+ "expression": "user_id",
8833+ "isExpression": false,
8834+ "asc": true,
8835+ "nulls": "last"
8836+ }
8837+ ],
8838+ "isUnique": false,
8839+ "concurrently": false,
8840+ "method": "btree",
8841+ "with": {}
8842+ },
8843+ "trusted_devices_token_uq": {
8844+ "name": "trusted_devices_token_uq",
8845+ "columns": [
8846+ {
8847+ "expression": "token_hash",
8848+ "isExpression": false,
8849+ "asc": true,
8850+ "nulls": "last"
8851+ }
8852+ ],
8853+ "isUnique": true,
8854+ "concurrently": false,
8855+ "method": "btree",
8856+ "with": {}
8857+ }
8858+ },
8859+ "foreignKeys": {},
8860+ "compositePrimaryKeys": {},
8861+ "uniqueConstraints": {},
8862+ "policies": {},
8863+ "checkConstraints": {},
8864+ "isRLSEnabled": false
8865+ },
8866+ "public.uploads": {
8867+ "name": "uploads",
8868+ "schema": "",
8869+ "columns": {
8870+ "id": {
8871+ "name": "id",
8872+ "type": "text",
8873+ "primaryKey": true,
8874+ "notNull": true
8875+ },
8876+ "user_id": {
8877+ "name": "user_id",
8878+ "type": "text",
8879+ "primaryKey": false,
8880+ "notNull": true
8881+ },
8882+ "kind": {
8883+ "name": "kind",
8884+ "type": "text",
8885+ "primaryKey": false,
8886+ "notNull": true
8887+ },
8888+ "path": {
8889+ "name": "path",
8890+ "type": "text",
8891+ "primaryKey": false,
8892+ "notNull": true
8893+ },
8894+ "mime": {
8895+ "name": "mime",
8896+ "type": "text",
8897+ "primaryKey": false,
8898+ "notNull": true
8899+ },
8900+ "bytes": {
8901+ "name": "bytes",
8902+ "type": "integer",
8903+ "primaryKey": false,
8904+ "notNull": true
8905+ },
8906+ "width": {
8907+ "name": "width",
8908+ "type": "integer",
8909+ "primaryKey": false,
8910+ "notNull": false
8911+ },
8912+ "height": {
8913+ "name": "height",
8914+ "type": "integer",
8915+ "primaryKey": false,
8916+ "notNull": false
8917+ },
8918+ "created_at": {
8919+ "name": "created_at",
8920+ "type": "timestamp with time zone",
8921+ "primaryKey": false,
8922+ "notNull": true,
8923+ "default": "now()"
8924+ }
8925+ },
8926+ "indexes": {
8927+ "uploads_user_idx": {
8928+ "name": "uploads_user_idx",
8929+ "columns": [
8930+ {
8931+ "expression": "user_id",
8932+ "isExpression": false,
8933+ "asc": true,
8934+ "nulls": "last"
8935+ }
8936+ ],
8937+ "isUnique": false,
8938+ "concurrently": false,
8939+ "method": "btree",
8940+ "with": {}
8941+ }
8942+ },
8943+ "foreignKeys": {},
8944+ "compositePrimaryKeys": {},
8945+ "uniqueConstraints": {},
8946+ "policies": {},
8947+ "checkConstraints": {},
8948+ "isRLSEnabled": false
8949+ },
8950+ "public.user_badges": {
8951+ "name": "user_badges",
8952+ "schema": "",
8953+ "columns": {
8954+ "user_id": {
8955+ "name": "user_id",
8956+ "type": "text",
8957+ "primaryKey": false,
8958+ "notNull": true
8959+ },
8960+ "badge": {
8961+ "name": "badge",
8962+ "type": "text",
8963+ "primaryKey": false,
8964+ "notNull": true
8965+ },
8966+ "evidence": {
8967+ "name": "evidence",
8968+ "type": "jsonb",
8969+ "primaryKey": false,
8970+ "notNull": true,
8971+ "default": "'{}'::jsonb"
8972+ },
8973+ "created_at": {
8974+ "name": "created_at",
8975+ "type": "timestamp with time zone",
8976+ "primaryKey": false,
8977+ "notNull": true,
8978+ "default": "now()"
8979+ }
8980+ },
8981+ "indexes": {
8982+ "user_badges_uq": {
8983+ "name": "user_badges_uq",
8984+ "columns": [
8985+ {
8986+ "expression": "user_id",
8987+ "isExpression": false,
8988+ "asc": true,
8989+ "nulls": "last"
8990+ },
8991+ {
8992+ "expression": "badge",
8993+ "isExpression": false,
8994+ "asc": true,
8995+ "nulls": "last"
8996+ }
8997+ ],
8998+ "isUnique": true,
8999+ "concurrently": false,
9000+ "method": "btree",
9001+ "with": {}
9002+ }
9003+ },
9004+ "foreignKeys": {},
9005+ "compositePrimaryKeys": {},
9006+ "uniqueConstraints": {},
9007+ "policies": {},
9008+ "checkConstraints": {},
9009+ "isRLSEnabled": false
9010+ }
9011+ },
9012+ "enums": {},
9013+ "schemas": {},
9014+ "sequences": {},
9015+ "roles": {},
9016+ "policies": {},
9017+ "views": {
9018+ "public.listings_multi_currency": {
9019+ "columns": {
9020+ "listing_id": {
9021+ "name": "listing_id",
9022+ "type": "text",
9023+ "primaryKey": false,
9024+ "notNull": false
9025+ },
9026+ "asset_id": {
9027+ "name": "asset_id",
9028+ "type": "text",
9029+ "primaryKey": false,
9030+ "notNull": false
9031+ },
9032+ "last_seen_at": {
9033+ "name": "last_seen_at",
9034+ "type": "timestamp with time zone",
9035+ "primaryKey": false,
9036+ "notNull": false
9037+ },
9038+ "price": {
9039+ "name": "price",
9040+ "type": "numeric(18, 4)",
9041+ "primaryKey": false,
9042+ "notNull": false
9043+ },
9044+ "currency": {
9045+ "name": "currency",
9046+ "type": "text",
9047+ "primaryKey": false,
9048+ "notNull": false
9049+ },
9050+ "price_usd": {
9051+ "name": "price_usd",
9052+ "type": "numeric(18, 4)",
9053+ "primaryKey": false,
9054+ "notNull": false
9055+ },
9056+ "price_cad": {
9057+ "name": "price_cad",
9058+ "type": "numeric(18, 4)",
9059+ "primaryKey": false,
9060+ "notNull": false
9061+ },
9062+ "price_eur": {
9063+ "name": "price_eur",
9064+ "type": "numeric(18, 4)",
9065+ "primaryKey": false,
9066+ "notNull": false
9067+ },
9068+ "price_gbp": {
9069+ "name": "price_gbp",
9070+ "type": "numeric(18, 4)",
9071+ "primaryKey": false,
9072+ "notNull": false
9073+ },
9074+ "price_jpy": {
9075+ "name": "price_jpy",
9076+ "type": "numeric(18, 4)",
9077+ "primaryKey": false,
9078+ "notNull": false
9079+ }
9080+ },
9081+ "definition": "\n select l.id as listing_id, l.asset_id, l.last_seen_at, l.price, l.currency, l.price_usd,\n l.price_usd * cad.rate as price_cad, l.price_usd * eur.rate as price_eur, l.price_usd * gbp.rate as price_gbp, l.price_usd * jpy.rate as price_jpy\n from listings l\n left join lateral (select f.rate from fx_rates f where f.base = 'USD' and f.quote = 'CAD' and f.date <= l.last_seen_at::date order by f.date desc limit 1) cad on true\n left join lateral (select f.rate from fx_rates f where f.base = 'USD' and f.quote = 'EUR' and f.date <= l.last_seen_at::date order by f.date desc limit 1) eur on true\n left join lateral (select f.rate from fx_rates f where f.base = 'USD' and f.quote = 'GBP' and f.date <= l.last_seen_at::date order by f.date desc limit 1) gbp on true\n left join lateral (select f.rate from fx_rates f where f.base = 'USD' and f.quote = 'JPY' and f.date <= l.last_seen_at::date order by f.date desc limit 1) jpy on true\n",
9082+ "name": "listings_multi_currency",
9083+ "schema": "public",
9084+ "isExisting": false,
9085+ "materialized": false
9086+ },
9087+ "public.sales_multi_currency": {
9088+ "columns": {
9089+ "sale_id": {
9090+ "name": "sale_id",
9091+ "type": "text",
9092+ "primaryKey": false,
9093+ "notNull": false
9094+ },
9095+ "asset_id": {
9096+ "name": "asset_id",
9097+ "type": "text",
9098+ "primaryKey": false,
9099+ "notNull": false
9100+ },
9101+ "sale_date": {
9102+ "name": "sale_date",
9103+ "type": "timestamp with time zone",
9104+ "primaryKey": false,
9105+ "notNull": false
9106+ },
9107+ "price": {
9108+ "name": "price",
9109+ "type": "numeric(18, 4)",
9110+ "primaryKey": false,
9111+ "notNull": false
9112+ },
9113+ "currency": {
9114+ "name": "currency",
9115+ "type": "text",
9116+ "primaryKey": false,
9117+ "notNull": false
9118+ },
9119+ "price_usd": {
9120+ "name": "price_usd",
9121+ "type": "numeric(18, 4)",
9122+ "primaryKey": false,
9123+ "notNull": false
9124+ },
9125+ "price_cad": {
9126+ "name": "price_cad",
9127+ "type": "numeric(18, 4)",
9128+ "primaryKey": false,
9129+ "notNull": false
9130+ },
9131+ "price_eur": {
9132+ "name": "price_eur",
9133+ "type": "numeric(18, 4)",
9134+ "primaryKey": false,
9135+ "notNull": false
9136+ },
9137+ "price_gbp": {
9138+ "name": "price_gbp",
9139+ "type": "numeric(18, 4)",
9140+ "primaryKey": false,
9141+ "notNull": false
9142+ },
9143+ "price_jpy": {
9144+ "name": "price_jpy",
9145+ "type": "numeric(18, 4)",
9146+ "primaryKey": false,
9147+ "notNull": false
9148+ },
9149+ "fx_date_cad": {
9150+ "name": "fx_date_cad",
9151+ "type": "date",
9152+ "primaryKey": false,
9153+ "notNull": false
9154+ },
9155+ "fx_date_eur": {
9156+ "name": "fx_date_eur",
9157+ "type": "date",
9158+ "primaryKey": false,
9159+ "notNull": false
9160+ },
9161+ "fx_date_gbp": {
9162+ "name": "fx_date_gbp",
9163+ "type": "date",
9164+ "primaryKey": false,
9165+ "notNull": false
9166+ },
9167+ "fx_date_jpy": {
9168+ "name": "fx_date_jpy",
9169+ "type": "date",
9170+ "primaryKey": false,
9171+ "notNull": false
9172+ }
9173+ },
9174+ "definition": "\n select s.id as sale_id, s.asset_id, s.sale_date, s.price, s.currency, s.price_usd,\n s.price_usd * cad.rate as price_cad, s.price_usd * eur.rate as price_eur, s.price_usd * gbp.rate as price_gbp, s.price_usd * jpy.rate as price_jpy,\n cad.date as fx_date_cad, eur.date as fx_date_eur, gbp.date as fx_date_gbp, jpy.date as fx_date_jpy\n from sales s\n left join lateral (select f.rate, f.date from fx_rates f where f.base = 'USD' and f.quote = 'CAD' and f.date <= s.sale_date::date order by f.date desc limit 1) cad on true\n left join lateral (select f.rate, f.date from fx_rates f where f.base = 'USD' and f.quote = 'EUR' and f.date <= s.sale_date::date order by f.date desc limit 1) eur on true\n left join lateral (select f.rate, f.date from fx_rates f where f.base = 'USD' and f.quote = 'GBP' and f.date <= s.sale_date::date order by f.date desc limit 1) gbp on true\n left join lateral (select f.rate, f.date from fx_rates f where f.base = 'USD' and f.quote = 'JPY' and f.date <= s.sale_date::date order by f.date desc limit 1) jpy on true\n",
9175+ "name": "sales_multi_currency",
9176+ "schema": "public",
9177+ "isExisting": false,
9178+ "materialized": false
9179+ }
9180+ },
9181+ "_meta": {
9182+ "columns": {},
9183+ "schemas": {},
9184+ "tables": {}
9185+ }
9186+}
\ No newline at end of file
modified packages/database/migrations/meta/_journal.json +7 −0
@@ -50,6 +50,13 @@
50 "when": 1789101341333, 50 "when": 1789101341333,
51 "tag": "0006_skinny_kulan_gath", 51 "tag": "0006_skinny_kulan_gath",
52 "breakpoints": true 52 "breakpoints": true
53+ },
54+ {
55+ "idx": 7,
56+ "version": "7",
57+ "when": 1789106686760,
58+ "tag": "0007_organic_colonel_america",
59+ "breakpoints": true
53 } 60 }
54 ] 61 ]
55 } 62 }
\ No newline at end of file
modified packages/database/src/schema/market.ts +27 −1
@@ -23,6 +23,11 @@ export const sales = pgTable(
23 fxRate: real('fx_rate'), 23 fxRate: real('fx_rate'),
24 fxDate: date('fx_date'), 24 fxDate: date('fx_date'),
25 buyerPremiumIncluded: boolean('buyer_premium_included'), 25 buyerPremiumIncluded: boolean('buyer_premium_included'),
26+ /** buyer-pays price in USD: price_usd + estimated buyer premium when the record is hammer-only (§35) */
27+ allInUsd: money('all_in_usd'),
28+ /** included | added_published | added_approximate | added_default | none | unknown */
29+ feeBasis: text('fee_basis'),
30+ buyerPremiumRate: real('buyer_premium_rate'),
26 quantity: integer('quantity').notNull().default(1), 31 quantity: integer('quantity').notNull().default(1),
27 isBundle: boolean('is_bundle').notNull().default(false), 32 isBundle: boolean('is_bundle').notNull().default(false),
28 condition: text('condition'), 33 condition: text('condition'),
@@ -162,6 +167,27 @@ export const auctionLots = pgTable(
162 hammerPrice: money('hammer_price'), 167 hammerPrice: money('hammer_price'),
163 currency: text('currency'), 168 currency: text('currency'),
164 bidCount: integer('bid_count'), 169 bidCount: integer('bid_count'),
170+ // ---- USD normalisation + auction intelligence (§33–§35), written by workers/auctions ----
171+ estimateLowUsd: money('estimate_low_usd'),
172+ estimateHighUsd: money('estimate_high_usd'),
173+ currentBidUsd: money('current_bid_usd'),
174+ hammerPriceUsd: money('hammer_price_usd'),
175+ fxRate: real('fx_rate'),
176+ fxDate: date('fx_date'),
177+ buyerPremiumRate: real('buyer_premium_rate'),
178+ feeBasis: text('fee_basis'),
179+ /** buyer-pays cost of the current bid (or low estimate when no bid) in USD, premium included */
180+ allInBidUsd: money('all_in_bid_usd'),
181+ allInEstimateLowUsd: money('all_in_estimate_low_usd'),
182+ allInEstimateHighUsd: money('all_in_estimate_high_usd'),
183+ rivUsdAtAssessment: money('riv_usd_at_assessment'),
184+ /** (all-in bid − RIV) / RIV, same sign convention as listings.discount_to_riv; null when ungated */
185+ bidVsRiv: real('bid_vs_riv'),
186+ /** (all-in low estimate − RIV) / RIV */
187+ estimateVsRiv: real('estimate_vs_riv'),
188+ /** deal | fair | premium | review | anomaly | ungated */
189+ assessmentVerdict: text('assessment_verdict'),
190+ assessedAt: ts('assessed_at'),
165 startsAt: ts('starts_at'), 191 startsAt: ts('starts_at'),
166 endsAt: ts('ends_at'), 192 endsAt: ts('ends_at'),
167 status: text('status').notNull().default('upcoming'), 193 status: text('status').notNull().default('upcoming'),
@@ -171,7 +197,7 @@ export const auctionLots = pgTable(
171 createdAt: createdAt(), 197 createdAt: createdAt(),
172 updatedAt: updatedAt(), 198 updatedAt: updatedAt(),
173 }, 199 },
174− (t) => [uniqueIndex('auction_lots_url_uq').on(t.url), index('auction_lots_auction_idx').on(t.auctionId), index('auction_lots_asset_idx').on(t.assetId), index('auction_lots_ends_idx').on(t.endsAt)], 200+ (t) => [uniqueIndex('auction_lots_url_uq').on(t.url), index('auction_lots_auction_idx').on(t.auctionId), index('auction_lots_asset_idx').on(t.assetId), index('auction_lots_ends_idx').on(t.endsAt), index('auction_lots_status_ends_idx').on(t.status, t.endsAt), index('auction_lots_bid_vs_riv_idx').on(t.bidVsRiv).where(sql`bid_vs_riv is not null and status in ('live','upcoming')`)],
175 ); 201 );
176 202
177 /** Price-guide observations (market/low/mid/high) — informative, weighted below transactions. */ 203 /** Price-guide observations (market/low/mid/high) — informative, weighted below transactions. */
added packages/valuation/src/fees.test.ts +48 −0
@@ -0,0 +1,48 @@
1+import { describe, expect, it } from 'vitest';
2+import { allInPrice, buyerPremium, feeScheduleFor, FEE_SCHEDULES } from './fees.js';
3+
4+describe('buyer premium schedules (§35)', () => {
5+ it('finds houses by name, connector id and tolerant alias', () => {
6+ expect(feeScheduleFor("Sotheby's")?.id).toBe('sothebys');
7+ expect(feeScheduleFor('bring-a-trailer')?.id).toBe('bring-a-trailer');
8+ expect(feeScheduleFor("Sotheby's Hong Kong")?.id).toBe('sothebys');
9+ expect(feeScheduleFor('Some Unknown Auctioneer')).toBeUndefined();
10+ });
11+ it('applies marginal tiers', () => {
12+ const s = feeScheduleFor("Sotheby's")!;
13+ expect(buyerPremium(100_000, s).premium).toBe(27_000);
14+ // 1,000,000 × 27 % + 500,000 × 22 %
15+ expect(buyerPremium(1_500_000, s).premium).toBe(380_000);
16+ expect(buyerPremium(1_500_000, s).allIn).toBe(1_880_000);
17+ });
18+ it('applies minimum, maximum and fixed fees', () => {
19+ const bat = feeScheduleFor('Bring a Trailer')!;
20+ expect(buyerPremium(1_000, bat).premium).toBe(250); // minimum
21+ expect(buyerPremium(500_000, bat).premium).toBe(7_500); // cap
22+ expect(buyerPremium(40_000, bat).premium).toBe(2_000);
23+ const cw = feeScheduleFor('Catawiki')!;
24+ expect(buyerPremium(100, cw).premium).toBe(10); // 9 % + €1
25+ });
26+ it('converts tier boundaries when the lot is billed in another currency', () => {
27+ const s = feeScheduleFor("Sotheby's")!;
28+ // 1,200,000 EUR at 1.1 USD/EUR = 1,320,000 USD → 1,000,000 × 27 % + 320,000 × 22 % = 340,400 USD → /1.1 = 309,454.55 EUR
29+ expect(buyerPremium(1_200_000, s, { fxToScheduleCurrency: 1.1 }).premium).toBeCloseTo(309_454.55, 1);
30+ });
31+ it('all-in price follows the connector flag and the source type', () => {
32+ expect(allInPrice({ price: 1000, buyerPremiumIncluded: true, house: 'Goldin' })).toMatchObject({ allIn: 1000, basis: 'included' });
33+ expect(allInPrice({ price: 1000, buyerPremiumIncluded: false, house: 'Goldin' })).toMatchObject({ allIn: 1200, basis: 'added_published' });
34+ expect(allInPrice({ price: 1000, buyerPremiumIncluded: false, house: 'Noonans' })).toMatchObject({ allIn: 1240, basis: 'added_approximate' });
35+ expect(allInPrice({ price: 1000, buyerPremiumIncluded: false, house: 'Unknown House' })).toMatchObject({ allIn: 1220, basis: 'added_default' });
36+ expect(allInPrice({ price: 1000, buyerPremiumIncluded: null, house: 'Mecum Auctions' })).toMatchObject({ allIn: 1100, basis: 'added_approximate' });
37+ expect(allInPrice({ price: 1000, buyerPremiumIncluded: null, house: 'Totally Unknown' })).toMatchObject({ allIn: 1000, basis: 'unknown' });
38+ expect(allInPrice({ price: 1000, buyerPremiumIncluded: null, house: 'ComicLink' })).toMatchObject({ allIn: 1000, basis: 'none' });
39+ expect(allInPrice({ price: 1000, buyerPremiumIncluded: null, saleType: 'fixed_price', sourceType: 'marketplace' })).toMatchObject({ allIn: 1000, basis: 'none' });
40+ });
41+ it('every schedule has sane tiers', () => {
42+ for (const s of FEE_SCHEDULES) {
43+ expect(s.tiers.length).toBeGreaterThan(0);
44+ expect(s.tiers.at(-1)!.upTo).toBeNull();
45+ for (const t of s.tiers) expect(t.rate).toBeGreaterThanOrEqual(0), expect(t.rate).toBeLessThan(0.5);
46+ }
47+ });
48+});
added packages/valuation/src/fees.ts +167 −0
@@ -0,0 +1,167 @@
1+/**
2+ * Buyer's premium and all-in cost (§34–§35). A hammer price is never comparable with a marketplace
3+ * price: RareIndex adds the house's buyer premium (published or approximate schedule, marginal tiers)
4+ * and labels the basis of every all-in figure. VAT/sales tax on the premium, duties and shipping are
5+ * out of scope and stated as such.
6+ */
7+import feesJson from '../../../data/fees/auction-houses.json' with { type: 'json' };
8+import { round } from '@rareindex/shared';
9+
10+export type FeeConfidence = 'published' | 'approximate' | 'none' | 'default' | 'unknown';
11+/** How an all-in figure was obtained. */
12+export type FeeBasis = 'included' | 'added_published' | 'added_approximate' | 'added_default' | 'none' | 'unknown';
13+
14+export interface FeeTier {
15+ /** upper bound of the tier in the schedule currency (null = open-ended) */
16+ upTo: number | null;
17+ rate: number;
18+}
19+export interface FeeSchedule {
20+ id: string;
21+ name: string;
22+ aliases: string[];
23+ currency: string;
24+ tiers: FeeTier[];
25+ minimum?: number;
26+ maximum?: number;
27+ fixedFee?: number;
28+ confidence: FeeConfidence;
29+ source?: string;
30+ note?: string;
31+}
32+
33+interface FeesFile {
34+ version: number;
35+ as_of: string;
36+ default: { auction_house: { rate: number; confidence: FeeConfidence; note: string }; marketplace: { rate: number; confidence: FeeConfidence; note: string } };
37+ houses: FeeSchedule[];
38+}
39+const FEES = feesJson as unknown as FeesFile;
40+export const FEE_SCHEDULE_AS_OF = FEES.as_of;
41+export const FEE_SCHEDULES: readonly FeeSchedule[] = FEES.houses;
42+
43+const byAlias = new Map<string, FeeSchedule>();
44+const norm = (s: string) => s.trim().toLowerCase().replace(/[’']/g, "'").replace(/\s+/g, ' ');
45+for (const h of FEES.houses) {
46+ byAlias.set(norm(h.id), h);
47+ byAlias.set(norm(h.name), h);
48+ for (const a of h.aliases) byAlias.set(norm(a), h);
49+}
50+
51+/** Find a schedule by house name, connector id or alias; undefined when the house is not listed. */
52+export function feeScheduleFor(house: string | null | undefined): FeeSchedule | undefined {
53+ if (!house) return undefined;
54+ const k = norm(house);
55+ const hit = byAlias.get(k);
56+ if (hit) return hit;
57+ // tolerant match: "Sotheby's Hong Kong" → Sotheby's
58+ for (const [alias, h] of byAlias) if (alias.length >= 5 && (k.startsWith(alias) || k.includes(alias))) return h;
59+ return undefined;
60+}
61+
62+export interface PremiumResult {
63+ /** premium amount in the hammer's currency */
64+ premium: number;
65+ /** effective rate = premium / hammer (0 when hammer is 0) */
66+ rate: number;
67+ allIn: number;
68+ confidence: FeeConfidence;
69+ scheduleId: string | null;
70+ note?: string;
71+}
72+
73+/**
74+ * Buyer premium on a hammer price, applying marginal tiers, minimum/maximum and fixed fees.
75+ * `fxToScheduleCurrency` converts the hammer into the schedule currency for tier boundaries when the
76+ * lot is billed in another currency (1 when not provided); the premium is returned in the hammer's currency.
77+ */
78+export function buyerPremium(hammer: number, schedule: FeeSchedule | undefined, opts: { fxToScheduleCurrency?: number; fallback?: 'auction_house' | 'marketplace' } = {}): PremiumResult {
79+ if (!(hammer > 0)) return { premium: 0, rate: 0, allIn: Math.max(0, hammer), confidence: schedule?.confidence ?? 'unknown', scheduleId: schedule?.id ?? null };
80+ if (!schedule) {
81+ const d = FEES.default[opts.fallback ?? 'auction_house'];
82+ const premium = round(hammer * d.rate, 2);
83+ return { premium, rate: d.rate, allIn: round(hammer + premium, 2), confidence: d.confidence, scheduleId: null, note: d.note };
84+ }
85+ const fx = opts.fxToScheduleCurrency ?? 1;
86+ const inSchedule = hammer * fx;
87+ let remaining = inSchedule;
88+ let lower = 0;
89+ let premiumSched = 0;
90+ for (const t of schedule.tiers) {
91+ const cap = t.upTo ?? Number.POSITIVE_INFINITY;
92+ const slice = Math.max(0, Math.min(inSchedule, cap) - lower);
93+ premiumSched += slice * t.rate;
94+ remaining -= slice;
95+ lower = cap;
96+ if (remaining <= 0) break;
97+ }
98+ if (schedule.fixedFee) premiumSched += schedule.fixedFee;
99+ if (schedule.minimum !== undefined) premiumSched = Math.max(premiumSched, schedule.minimum);
100+ if (schedule.maximum !== undefined) premiumSched = Math.min(premiumSched, schedule.maximum);
101+ const premium = round(premiumSched / fx, 2);
102+ return { premium, rate: hammer ? round(premium / hammer, 4) : 0, allIn: round(hammer + premium, 2), confidence: schedule.confidence, scheduleId: schedule.id, note: schedule.note };
103+}
104+
105+export interface AllInInput {
106+ price: number;
107+ /** connector-reported flag: true = price already includes the buyer premium; false = hammer only; null = unknown */
108+ buyerPremiumIncluded: boolean | null | undefined;
109+ /** auction house name / connector id for the schedule lookup */
110+ house?: string | null;
111+ /** 'auction' | 'fixed_price' | … — marketplaces have no buyer premium */
112+ saleType?: string | null;
113+ sourceType?: string | null;
114+ fxToScheduleCurrency?: number;
115+}
116+
117+export interface AllInResult {
118+ allIn: number;
119+ rate: number;
120+ basis: FeeBasis;
121+ scheduleId: string | null;
122+ note?: string;
123+}
124+
125+/**
126+ * All-in (buyer pays) price for a sale or a bid. Rules:
127+ * - premium already included → unchanged (`included`);
128+ * - fixed-price / marketplace records → unchanged (`none`);
129+ * - hammer only (flag false) → add the house schedule (`added_published|approximate|default`);
130+ * - flag unknown → add the schedule only when the house is listed with a non-zero schedule and the
131+ * record is an auction; otherwise unchanged and `unknown` so the UI can say "fees unknown".
132+ */
133+export function allInPrice(i: AllInInput): AllInResult {
134+ const isAuction = (i.saleType ?? 'auction') === 'auction' || i.sourceType === 'auction_house';
135+ if (i.buyerPremiumIncluded === true) return { allIn: i.price, rate: 0, basis: 'included', scheduleId: null };
136+ if (!isAuction || i.sourceType === 'marketplace' || i.sourceType === 'dealer' || i.sourceType === 'pricing_guide') return { allIn: i.price, rate: 0, basis: 'none', scheduleId: null };
137+ const schedule = feeScheduleFor(i.house);
138+ if (i.buyerPremiumIncluded === false) {
139+ const p = buyerPremium(i.price, schedule, { fxToScheduleCurrency: i.fxToScheduleCurrency });
140+ return { allIn: p.allIn, rate: p.rate, basis: schedule ? (schedule.confidence === 'published' ? 'added_published' : schedule.confidence === 'none' ? 'none' : 'added_approximate') : 'added_default', scheduleId: p.scheduleId, note: p.note };
141+ }
142+ // unknown flag
143+ if (schedule && schedule.tiers.some((t) => t.rate > 0)) {
144+ const p = buyerPremium(i.price, schedule, { fxToScheduleCurrency: i.fxToScheduleCurrency });
145+ return { allIn: p.allIn, rate: p.rate, basis: schedule.confidence === 'published' ? 'added_published' : 'added_approximate', scheduleId: p.scheduleId, note: p.note };
146+ }
147+ if (schedule) return { allIn: i.price, rate: 0, basis: 'none', scheduleId: schedule.id, note: schedule.note };
148+ return { allIn: i.price, rate: 0, basis: 'unknown', scheduleId: null };
149+}
150+
151+/** Human label for a fee basis, for tables and tooltips. */
152+export function feeBasisLabel(basis: FeeBasis | string | null | undefined): string {
153+ switch (basis) {
154+ case 'included':
155+ return 'premium included';
156+ case 'added_published':
157+ return 'premium added (published schedule)';
158+ case 'added_approximate':
159+ return 'premium added (≈ estimated schedule)';
160+ case 'added_default':
161+ return 'premium added (default 22 %, house unknown)';
162+ case 'none':
163+ return 'no buyer premium';
164+ default:
165+ return 'fees unknown';
166+ }
167+}
modified packages/valuation/src/index.ts +1 −0
@@ -5,3 +5,4 @@ export * from './scores.js';
5 export * from './depth.js'; 5 export * from './depth.js';
6 export * from './liquidation.js'; 6 export * from './liquidation.js';
7 export * from './verification.js'; 7 export * from './verification.js';
8+export * from './fees.js';
8 9
Menu

Theme