feat: add per-user tenant scoping
This commit is contained in:
+13
-1
@@ -6,16 +6,28 @@ Table thoughts {
|
||||
created_at timestamptz [default: `now()`]
|
||||
updated_at timestamptz [default: `now()`]
|
||||
project_id bigint [ref: > projects.id]
|
||||
tenant_key text
|
||||
archived_at timestamptz
|
||||
|
||||
indexes {
|
||||
tenant_key
|
||||
(tenant_key, project_id)
|
||||
}
|
||||
}
|
||||
|
||||
Table projects {
|
||||
id bigserial [pk]
|
||||
guid uuid [unique, not null, default: `gen_random_uuid()`]
|
||||
name text [unique, not null]
|
||||
name text [not null]
|
||||
description text
|
||||
tenant_key text
|
||||
created_at timestamptz [default: `now()`]
|
||||
last_active_at timestamptz [default: `now()`]
|
||||
|
||||
indexes {
|
||||
(tenant_key, name) [unique]
|
||||
tenant_key
|
||||
}
|
||||
}
|
||||
|
||||
Table thought_links {
|
||||
|
||||
Reference in New Issue
Block a user