implementando openAI y busqueda de productos en woo
This commit is contained in:
21
db/migrations/20260105123000_woo_products_cache.sql
Normal file
21
db/migrations/20260105123000_woo_products_cache.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
-- migrate:up
|
||||
create table if not exists woo_products_cache (
|
||||
tenant_id uuid not null references tenants(id) on delete cascade,
|
||||
woo_product_id integer not null,
|
||||
name text not null,
|
||||
sku text,
|
||||
price numeric(12,2),
|
||||
currency text,
|
||||
refreshed_at timestamptz not null default now(),
|
||||
payload jsonb not null default '{}'::jsonb,
|
||||
created_at timestamptz not null default now(),
|
||||
updated_at timestamptz not null default now(),
|
||||
primary key (tenant_id, woo_product_id)
|
||||
);
|
||||
|
||||
create index if not exists woo_products_cache_tenant_name_idx on woo_products_cache (tenant_id, lower(name));
|
||||
|
||||
create index if not exists woo_products_cache_tenant_sku_idx on woo_products_cache (tenant_id, sku);
|
||||
|
||||
-- migrate:down
|
||||
drop table if exists woo_products_cache;
|
||||
Reference in New Issue
Block a user