[RFC] attachment_s3: Support for database operations
max3903 opened this issue · 4 comments
We would like to add the support for the following database operations with the Odoo DB manager:
- creation: When the module is installed, check the environment variables, set the config parameters, create the bucket and run force_storage().
- deletion: When the database is dropped, delete the bucket.
- duplication: When the database is duplicated, duplicate the bucket and update the store_fname in the ir_attachment table:
UPDATE ir_attachment AS t
SET store_fname = s.store_fname
FROM (
SELECT id,REPLACE(store_fname, 'old', 'new') AS store_fname
FROM ir_attachment
WHERE db_datas is NULL)
AS s(id,store_fname)
WHERE t.id = s.id;
In version 12 and 14.
Hi @max3903
I've similar needs, please check #233 and #234 In case you share those ideas.
Regarding your suggestions (that would be complementary to the ones I've share), this is my POV:
- creation: When the module is installed, check the environment variables, set the config parameters and run force_storage(). --> I would remove the creation of the bucket so that the environment keys don't require rights to create buckets, may be it could be optional or check if it exists or not and both use cases would be covered (in my use case I would create the bucket before calling the create database)
- deletion: When the database is dropped, delete the bucket. --> same as before, I prefer not, but if it's optional, no problem
- duplication: --> check my prs, In my mind nothing would be needed when duplicating, the idea would be to use same bucket and existing objects
If you like to share some thoughts about the big picture, we can schedule a call
BR
@jjscarafia The big picture I have is to replicate what Odoo does by default on the filesystem, so it is transparent to admin users. They can keep working the way they do without any limitations/risks as to where the filestore is.
There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.