feat: Introduce AI code hinting, enforce single-tenant organization model, and add a Code Lab block component.
This commit is contained in:
@@ -211,18 +211,12 @@ CREATE OR REPLACE FUNCTION fn_register_user(
|
||||
p_password_hash VARCHAR(255),
|
||||
p_full_name VARCHAR(255),
|
||||
p_role VARCHAR(50),
|
||||
p_org_name VARCHAR(255)
|
||||
p_org_name VARCHAR(255) -- Preserved for signature compatibility but ignored
|
||||
) RETURNS SETOF users AS $$
|
||||
DECLARE
|
||||
v_org_id UUID;
|
||||
v_org_id UUID := '00000000-0000-0000-0000-000000000001';
|
||||
BEGIN
|
||||
-- Find or create organization
|
||||
INSERT INTO organizations (name)
|
||||
VALUES (p_org_name)
|
||||
ON CONFLICT (name) DO UPDATE SET name = EXCLUDED.name
|
||||
RETURNING id INTO v_org_id;
|
||||
|
||||
-- Create user
|
||||
-- Create user in default organization
|
||||
RETURN QUERY
|
||||
INSERT INTO users (email, password_hash, full_name, role, organization_id)
|
||||
VALUES (p_email, p_password_hash, p_full_name, p_role, v_org_id)
|
||||
|
||||
Reference in New Issue
Block a user