Expand seller store functionality
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
SELECT
|
||||
u.id,
|
||||
u.email,
|
||||
u.display_name,
|
||||
u.status,
|
||||
u.created_at,
|
||||
u.last_login_at,
|
||||
w.id AS workspace_id,
|
||||
w.name AS workspace_name,
|
||||
m.role AS workspace_role
|
||||
FROM atlas.users u
|
||||
LEFT JOIN atlas.workspace_memberships m ON m.user_id = u.id
|
||||
LEFT JOIN atlas.workspaces w ON w.id = m.workspace_id
|
||||
ORDER BY u.created_at DESC;
|
||||
|
||||
SELECT code, name, capabilities
|
||||
FROM atlas.platforms
|
||||
WHERE code = 'OZON';
|
||||
|
||||
BEGIN;
|
||||
|
||||
SET search_path TO atlas, public;
|
||||
|
||||
INSERT INTO platform_currency_support (platform_id, currency_code)
|
||||
SELECT id, 'CNY'::CHAR(3)
|
||||
FROM platforms
|
||||
WHERE code = 'OZON'
|
||||
ON CONFLICT (platform_id, currency_code) DO UPDATE
|
||||
SET is_enabled = true;
|
||||
|
||||
UPDATE platforms
|
||||
SET capabilities = capabilities || jsonb_build_object(
|
||||
'default_currency_code', 'CNY'
|
||||
),
|
||||
updated_at = now()
|
||||
WHERE code = 'OZON';
|
||||
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user