CUPUM / nplex

Plateforme de valorisation de petits projets d'architecture et d'aménagement à Montréal.
https://www.nplex.design
4 stars 0 forks source link

Task: Simplify data management for projects (and other entities) using views rather than separate tables #154

Closed emmbm closed 1 year ago

emmbm commented 1 year ago

Task Description

Creating separate tables to limit update accesses to essential ressources sometimes leads to cases where we need on_create triggers to insert and relate required rows to main entities as well as before update and before delete triggers to protect said rows. This could be avoided by including these rows in the main entities tables, a thing we avoided to do initially to contain and control updatability with greater granularity.

After more reading, it appears using views (with security_invoker?) would allow us to simplify the public schema. Read: https://github.com/orgs/supabase/discussions/901 for an example.

List of actions

emmbm commented 1 year ago

Closing as this does not really apply to our current CRUD system. Drizzle does not currently support migrations for views nor implement the basis for using row level security policies based on auth users.