slunch
Tables (32)
allergens
- id — BIGINT — Primary key — NOT NULL
- code — VARCHAR(100) — NOT NULL
- translations — JSONB — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
cafe24_orders
- id — BIGINT — Primary key — NOT NULL
- cafe24_order_id — VARCHAR(100) — NOT NULL
- user_id — BIGINT
- channel — VARCHAR(20) — NOT NULL
- order_items — JSONB — NOT NULL
- total_amount — NUMERIC(12,2) — NOT NULL
- currency — VARCHAR(10) — NOT NULL
- payment_method — VARCHAR(50)
- buyer_name — VARCHAR(100) — NOT NULL
- buyer_phone — VARCHAR(30)
- buyer_email — VARCHAR(200)
- shipping_address — JSONB
- status — VARCHAR(20) — NOT NULL
- ordered_at — TIMESTAMPTZ — NOT NULL
- completed_at — TIMESTAMPTZ
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
categories
- id — BIGINT — Primary key — NOT NULL
- type — VARCHAR(50) — NOT NULL
- code — VARCHAR(100) — NOT NULL
- filter_layer — VARCHAR(20) — NOT NULL
- parent_id — BIGINT — Foreign key → categories.id
- translations — JSONB — NOT NULL
- sort_order — INT — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
daily_moods
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- mood_date — DATE — NOT NULL
- cooking_energy — VARCHAR(20)
- mood_tags — JSONB
- created_at — TIMESTAMPTZ — NOT NULL
exchange_rates
- id — BIGINT — Primary key — NOT NULL
- from_currency — VARCHAR(3) — NOT NULL
- to_currency — VARCHAR(3) — NOT NULL
- rate — NUMERIC(12,6) — NOT NULL
- source — VARCHAR(50) — NOT NULL
- fetched_at — TIMESTAMPTZ — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
fob_products
- id — BIGINT — Primary key — NOT NULL
- product_variant_id — BIGINT — NOT NULL
- storage_type — VARCHAR(20) — NOT NULL
- hs_code — VARCHAR(20)
- price_moq1 — NUMERIC(10,2)
- price_moq4 — NUMERIC(10,2)
- weight_g — INT
- srp — VARCHAR(100)
- units_per_carton — INT
- carton_net_kg — NUMERIC(6,2)
- carton_gross_kg — NUMERIC(6,2)
- cbm — NUMERIC(8,4)
- carton_size_mm — VARCHAR(100)
- cartons_per_pallet — VARCHAR(50)
- stacking — VARCHAR(100)
- shelf_life — VARCHAR(100)
- description — TEXT
- main_ingredients — TEXT
- origin — VARCHAR(100)
- moq — VARCHAR(100)
- tbd — BOOLEAN — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
fob_quotes
- id — BIGINT — Primary key — NOT NULL
- quote_number — VARCHAR(100) — NOT NULL
- buyer_name — VARCHAR(200) — NOT NULL
- buyer_company — VARCHAR(200) — NOT NULL
- buyer_email — VARCHAR(200) — NOT NULL
- buyer_country — VARCHAR(100) — NOT NULL
- quote_type — VARCHAR(30) — NOT NULL
- total_amount_usd — NUMERIC(12,2) — NOT NULL
- currency — VARCHAR(10) — NOT NULL
- buyer_phone — VARCHAR(50)
- memo — TEXT
- lang — VARCHAR(10)
- items — JSONB — NOT NULL
- status — VARCHAR(20) — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
ingredient_allergens
- ingredient_id — BIGINT — Foreign key → ingredients.id — NOT NULL
- allergen_id — BIGINT — Foreign key → allergens.id — NOT NULL
ingredient_market_prices
- id — BIGINT — Primary key — NOT NULL
- variable_id — BIGINT — Foreign key → ingredients_variable.id — NOT NULL
- price — NUMERIC(12,2) — NOT NULL
- currency — VARCHAR(10) — NOT NULL
- fetched_at — TIMESTAMPTZ — NOT NULL
ingredient_prices
- id — BIGINT — Primary key — NOT NULL
- ingredient_id — BIGINT — Foreign key → ingredients.id — NOT NULL
- price — NUMERIC(12,2) — NOT NULL
- currency — VARCHAR(10) — NOT NULL
- unit — VARCHAR(20) — NOT NULL
- fetched_at — TIMESTAMPTZ — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
ingredients
- id — BIGINT — Primary key — NOT NULL
- code — VARCHAR(100) — NOT NULL
- translations — JSONB — NOT NULL
- unit — VARCHAR(20) — NOT NULL
- origin_country — VARCHAR(100)
- is_active — BOOLEAN — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
ingredients_variable
- id — BIGINT — Primary key — NOT NULL
- ingredient_id — BIGINT — Foreign key → ingredients.id — NOT NULL
- origin — VARCHAR(100)
- weight_g — NUMERIC(10,2)
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
odm_quotes
- id — BIGINT — Primary key — NOT NULL
- quote_number — VARCHAR(100) — NOT NULL
- product_description — TEXT — NOT NULL
- fixed_total — NUMERIC(12,2) — NOT NULL
- company_name — VARCHAR(200) — NOT NULL
- contact_name — VARCHAR(200) — NOT NULL
- email — VARCHAR(200) — NOT NULL
- country — VARCHAR(100) — NOT NULL
- currency — VARCHAR(10) — NOT NULL
- storage_type — VARCHAR(20)
- packaging_type — VARCHAR(30)
- phone — VARCHAR(50)
- memo — TEXT
- pdf_url — VARCHAR(500)
- selections — JSONB — NOT NULL
- status — VARCHAR(20) — NOT NULL
- email_sent — BOOLEAN — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
oem_quotes
- id — BIGINT — Primary key — NOT NULL
- quote_number — VARCHAR(100) — NOT NULL
- product_id — BIGINT — NOT NULL
- storage_type — VARCHAR(20) — NOT NULL
- packaging_type — VARCHAR(30) — NOT NULL
- quantity — INT — NOT NULL
- fixed_total — NUMERIC(12,2) — NOT NULL
- variable_total — NUMERIC(12,2) — NOT NULL
- grand_total — NUMERIC(12,2) — NOT NULL
- company_name — VARCHAR(200) — NOT NULL
- contact_name — VARCHAR(200) — NOT NULL
- email — VARCHAR(200) — NOT NULL
- country — VARCHAR(100) — NOT NULL
- currency — VARCHAR(10) — NOT NULL
- unit_cost_before_discount — NUMERIC(12,2)
- discount_rate — NUMERIC(5,2)
- unit_cost — NUMERIC(12,2)
- exchange_rate_used — NUMERIC(12,6)
- phone — VARCHAR(50)
- memo — TEXT
- pdf_url — VARCHAR(500)
- selections — JSONB — NOT NULL
- status — VARCHAR(20) — NOT NULL
- email_sent — BOOLEAN — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
pricing_rules
- id — BIGINT — Primary key — NOT NULL
- rule_key — VARCHAR(100) — NOT NULL
- rule_type — VARCHAR(50) — NOT NULL
- currency — VARCHAR(10) — NOT NULL
- sort_order — INT — NOT NULL
- price — NUMERIC(12,2)
- options — JSONB — NOT NULL
- translations — JSONB — NOT NULL
- is_active — BOOLEAN — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
product_allergens
- product_id — BIGINT — Foreign key → products.id — NOT NULL
- allergen_id — BIGINT — Foreign key → allergens.id — NOT NULL
product_categories
- product_id — BIGINT — Foreign key → products.id — NOT NULL
- category_id — BIGINT — Foreign key → categories.id — NOT NULL
product_channel_stats
- id — BIGINT — Primary key — NOT NULL
- product_id — BIGINT — Foreign key → products.id — NOT NULL
- channel — VARCHAR(20) — NOT NULL
- stat_date — DATE — NOT NULL
- order_count — INT — NOT NULL
- quantity_sold — INT — NOT NULL
- revenue — NUMERIC(12,2) — NOT NULL
- view_count — INT — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
product_images
- id — BIGINT — Primary key — NOT NULL
- product_id — BIGINT — Foreign key → products.id — NOT NULL
- url — VARCHAR(500) — NOT NULL
- alt_text — VARCHAR(300)
- image_type — VARCHAR(10) — NOT NULL
- sort_order — INT — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
product_ingredients
- id — BIGINT — Primary key — NOT NULL
- product_id — BIGINT — Foreign key → products.id — NOT NULL
- ingredient_id — BIGINT — Foreign key → ingredients.id — NOT NULL
- name — VARCHAR(200) — NOT NULL
- percentage — NUMERIC(5,2) — NOT NULL
- sort_order — INT — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
product_variant_prices
- id — BIGINT — Primary key — NOT NULL
- variant_id — BIGINT — Foreign key → product_variants.id — NOT NULL
- channel — VARCHAR(20) — NOT NULL
- price — NUMERIC(12,2) — NOT NULL
- currency — VARCHAR(10) — NOT NULL
- is_active — BOOLEAN — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
product_variants
- id — BIGINT — Primary key — NOT NULL
- product_id — BIGINT — Foreign key → products.id — NOT NULL
- sku — VARCHAR(100) — NOT NULL
- weight_g — NUMERIC(10,2)
- packaging_type — VARCHAR(30)
- translations — JSONB — NOT NULL
- certifications — JSONB
- is_active — BOOLEAN — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
products
- id — BIGINT — Primary key — NOT NULL
- code — VARCHAR(100) — NOT NULL
- slug — VARCHAR(200) — NOT NULL
- storage_type — VARCHAR(20) — NOT NULL
- translations — JSONB — NOT NULL
- content_blocks — JSONB
- b2b_spec — JSONB
- is_published — BOOLEAN — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
recipe_categories
- recipe_id — BIGINT — Foreign key → recipes.id — NOT NULL
- category_id — BIGINT — Foreign key → categories.id — NOT NULL
recipe_ingredients
- id — BIGINT — Primary key — NOT NULL
- recipe_id — BIGINT — Foreign key → recipes.id — NOT NULL
- ingredient_id — BIGINT — Foreign key → ingredients.id — NOT NULL
- amount_g — NUMERIC(10,2) — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
recipes
- id — BIGINT — Primary key — NOT NULL
- code — VARCHAR(100) — NOT NULL
- parent_recipe_id — BIGINT — Foreign key → recipes.id
- translations — JSONB — NOT NULL
- is_active — BOOLEAN — NOT NULL
- difficulty — INT
- cooking_time — INT
- spice_level — INT
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
spirit_allergens
- allergen_id — BIGINT — Primary key — NOT NULL
- spirit_profile_id — BIGINT — Foreign key → spirit_profiles.id — NOT NULL
spirit_health_goals
- category_id — BIGINT — Primary key — NOT NULL
- spirit_profile_id — BIGINT — Foreign key → spirit_profiles.id — NOT NULL
spirit_profiles
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- dietary_type — VARCHAR(30)
- spice_tolerance — INT
- preference_weights — JSONB
- raw_answers — JSONB
- completed_at — TIMESTAMPTZ
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
user_ingredient_prefs
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- ingredient_id — BIGINT — NOT NULL
- pref_type — VARCHAR(10) — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
users
- id — BIGINT — Primary key — NOT NULL
- email — VARCHAR(200) — NOT NULL
- password_hash — VARCHAR(200)
- name — VARCHAR(100) — NOT NULL
- phone — VARCHAR(30)
- birthday — DATE
- locale — VARCHAR(10) — NOT NULL
- profile_image_url — VARCHAR(500)
- marketing_sms — BOOLEAN — NOT NULL
- marketing_email — BOOLEAN — NOT NULL
- status — VARCHAR(20) — NOT NULL
- email_verified — BOOLEAN — NOT NULL
- last_login_at — TIMESTAMPTZ
- withdrawn_at — TIMESTAMPTZ
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
veggiverse_products
- id — BIGINT — Primary key — NOT NULL
- product_id — BIGINT — Foreign key → products.id — NOT NULL
- serving_size — VARCHAR(50)
- cooking_guide — JSONB
- recipe_id — BIGINT
- translations — JSONB — NOT NULL
- is_published — BOOLEAN — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL