hamishcoding
07/29/2021, 5:31 PMAzura
07/29/2021, 5:31 PMsilentworks
07/29/2021, 5:31 PMhamishcoding
07/29/2021, 5:31 PMhamishcoding
07/29/2021, 5:34 PMehesp
07/29/2021, 6:37 PMehesp
07/29/2021, 6:37 PMcreate or replace function public.create_project_on_new_user()
returns trigger as $$
declare
new_project_id uuid;
begin
new_project_id = uuid_generate_v4();
-- insert into public.profiles (id, project) values (new.id, '');
-- insert into public.projects (id, type, name) values (new_project_id, 'PERSONAL', '...');
-- insert into public.profiles_projects (profile_id, project_id) values (new.id, new_project_id);
return new;
end;
$$ language plpgsql security definer;
ehesp
07/29/2021, 6:38 PMjon.m
07/29/2021, 7:49 PMricpt
07/30/2021, 12:00 AMricpt
07/30/2021, 12:00 AMScott P
07/30/2021, 12:04 AMauth.users.id
definitely a uuid
type (it is by default, but better to check)? You should be able to run SELECT column_name, data_type FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'users' AND table_schema = 'auth'
to checkricpt
07/30/2021, 12:09 AMScott P
07/30/2021, 12:12 AMricpt
07/30/2021, 12:13 AMricpt
07/30/2021, 12:13 AMricpt
07/30/2021, 12:14 AMScott P
07/30/2021, 12:17 AMricpt
07/30/2021, 12:21 AMricpt
07/30/2021, 12:21 AMricpt
07/30/2021, 12:21 AMlawrencecchen
07/30/2021, 1:36 AMhieu
07/30/2021, 1:44 AMlawrencecchen
07/30/2021, 1:44 AMlawrencecchen
07/30/2021, 1:44 AMlawrencecchen
07/30/2021, 1:44 AMlawrencecchen
07/30/2021, 1:45 AMhieu
07/30/2021, 1:45 AMsylar815
07/30/2021, 11:32 AMKosh
07/30/2021, 11:43 AM