Merge pull request #115 from Photowall/2369-rework-stock-product-handling
Remove references from old stock-tables
This commit is contained in:
@@ -47,4 +47,10 @@ To write new inserts into the DB generate sql files with js in the src/**test**/
|
|||||||
|
|
||||||
When you have the data you need in the db, write tests in all.test.ts file following the pattern already set.
|
When you have the data you need in the db, write tests in all.test.ts file following the pattern already set.
|
||||||
|
|
||||||
|
### Dump database schema
|
||||||
|
|
||||||
|
pg_dump \
|
||||||
|
--schema-only \
|
||||||
|
--no-owner \
|
||||||
|
--no-acl \
|
||||||
|
photowall > src/__test__/db/schema.sql
|
||||||
|
|||||||
+4075
-4135
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@ import { ProductsFilterInput } from '../../types/product-types';
|
|||||||
const baseQuery = /* sql */ `
|
const baseQuery = /* sql */ `
|
||||||
|
|
||||||
SELECT products.productid AS id,
|
SELECT products.productid AS id,
|
||||||
stock.stockid,
|
stock.id AS stockid,
|
||||||
products.path,
|
products.path,
|
||||||
products.visible,
|
products.visible,
|
||||||
products.browsable,
|
products.browsable,
|
||||||
@@ -73,7 +73,7 @@ SELECT products.productid AS id,
|
|||||||
WHERE wt.product_id = products.productid
|
WHERE wt.product_id = products.productid
|
||||||
) AS wallpapertypes
|
) AS wallpapertypes
|
||||||
FROM "product-products" products
|
FROM "product-products" products
|
||||||
LEFT JOIN "product-stockproducts" stock ON stock.productid = products.productid
|
LEFT JOIN stockproducts stock ON stock.product_id = products.productid
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export function products(input: ProductsFilterInput) {
|
export function products(input: ProductsFilterInput) {
|
||||||
|
|||||||
Reference in New Issue
Block a user