DharmaraJ
08/02/2021, 10:56 AMsilentworks
08/02/2021, 11:52 AMsilentworks
08/02/2021, 11:53 AMstorage.objects
tableDharmaraJ
08/02/2021, 11:54 AMsilentworks
08/02/2021, 11:55 AMa d
08/02/2021, 11:58 AMsilentworks
08/02/2021, 11:59 AMDharmaraJ
08/02/2021, 12:01 PMDharmaraJ
08/02/2021, 12:01 PMa d
08/02/2021, 12:01 PMsilentworks
08/02/2021, 12:01 PMDharmaraJ
08/02/2021, 12:02 PMsilentworks
08/02/2021, 12:02 PMsilentworks
08/02/2021, 12:02 PMDharmaraJ
08/02/2021, 12:03 PMsilentworks
08/02/2021, 12:04 PMDharmaraJ
08/02/2021, 12:04 PMDharmaraJ
08/02/2021, 12:04 PMsilentworks
08/02/2021, 12:06 PMDharmaraJ
08/02/2021, 12:06 PMsilentworks
08/02/2021, 12:07 PMimages
table to keep a reference of your files in storage
right?DharmaraJ
08/02/2021, 12:07 PMimages
bucketDharmaraJ
08/02/2021, 12:08 PMauth_logs
table too which was never added in this project..silentworks
08/02/2021, 12:10 PMsql
-- inserts a row into public.images
create function public.handle_add_storage()
returns trigger as $$
begin
insert into public.images (id, name)
values (new.id, new.name);
return new;
end;
$$ language plpgsql security definer;
silentworks
08/02/2021, 12:11 PMsql
-- trigger the function every time a file is uploaded
create trigger on_file_created
after insert on storage.objects
for each row execute procedure public.handle_add_storage();
silentworks
08/02/2021, 12:11 PMDharmaraJ
08/02/2021, 12:11 PMDharmaraJ
08/02/2021, 12:11 PMsilentworks
08/02/2021, 12:12 PMstorage.objects
table, this table is updated each time a new storage upload happensDharmaraJ
08/02/2021, 12:13 PMsilentworks
08/02/2021, 12:13 PMstorage.objects
table from the UI as it's not in the public
schemaDharmaraJ
08/02/2021, 12:14 PMsilentworks
08/02/2021, 12:14 PMDharmaraJ
08/02/2021, 12:16 PMDharmaraJ
08/02/2021, 12:16 PMDharmaraJ
08/02/2021, 12:16 PMsilentworks
08/02/2021, 12:18 PMDharmaraJ
08/02/2021, 12:19 PMeverconfusedguy
08/02/2021, 1:38 PMeverconfusedguy
08/02/2021, 1:38 PMDharmaraJ
08/02/2021, 1:41 PMeverconfusedguy
08/02/2021, 1:44 PMDharmaraJ
08/02/2021, 1:45 PMauth_logs
can be seen? I was able to see that in my first project and there was storage
table too. In new project there were not any default tables.everconfusedguy
08/02/2021, 1:46 PMeverconfusedguy
08/02/2021, 1:47 PMDharmaraJ
08/02/2021, 1:47 PMzisvh
10/05/2022, 9:12 AMsql
create function public.handle_add_storage()
returns trigger as $$
begin
insert into public.bayesgames (id, name, type, size, last_modified, data, inserted_at)
values (new.id, new.name, new.type, new.size, new.last_modified, new.data, new.inserted_at);
return new;
end;
$$ language plpgsql security definer;
and here is my trigger:
sql
create trigger on_file_created
after insert on storage.objects
for each row execute procedure public.handle_add_storage();
zisvh
10/05/2022, 9:12 AMsilentworks
10/05/2022, 11:03 AMzisvh
10/05/2022, 11:04 AMsilentworks
10/05/2022, 11:06 AMzisvh
10/05/2022, 11:07 AMsilentworks
10/05/2022, 11:07 AMzisvh
10/05/2022, 11:08 AMsilentworks
10/05/2022, 11:10 AMzisvh
10/05/2022, 11:10 AM