data_permissions


Description

A table to store database and table permissions

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id int4 10 √ null

{“what”:“Unique numeric identifier for each permission record.”,“why”:“Needed to reference a specific permission row; without it, rows cannot be uniquely identified.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:21.855651563+00:00”}

group_id int4 10 null
permissions_group.id fk_data_permissions_ref_permissions_group C

{“what”:“Identifier of the user group that this permission applies to.”,“why”:“Without it, we cannot know which group is granted the permission; permissions would be ambiguous.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:21.880822489+00:00”}

perm_type varchar 64 null

{“what”:“String code that distinguishes permission kinds; allowed values are application-defined.”,“why”:“Without it, we cannot differentiate between different operations or levels of access.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:21.935504528+00:00”}

db_id int4 10 null
metabase_database.id fk_data_permissions_ref_db_id C

{“what”:“Identifier of the database to which this permission applies.”,“why”:“Without it, we cannot scope the permission to a specific database; permissions would be ambiguous across databases.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:21.952999456+00:00”}

schema_name varchar 254 √ null

{“what”:“Name of the schema within the database; null if permission applies to whole database.”,“why”:“Without it, we cannot restrict permission to a specific schema; null indicates database-wide scope.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:21.968183494+00:00”}

table_id int4 10 √ null
metabase_table.id fk_data_permissions_ref_table_id C

{“what”:“Identifier of the table within the schema; null if permission applies to whole schema or database.”,“why”:“Without it, we cannot target a specific table; null indicates broader scope.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:21.983793185+00:00”}

perm_value varchar 64 null

{“what”:“String holding the permission’s specific value, such as a filter or column list; format depends on perm_type.”,“why”:“Without it, the permission lacks its specific constraint or parameter; the permission would be incomplete.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T00:03:22.000408315+00:00”}

Indexes

Constraint Name Type Sort Column(s)
data_permissions_pkey Primary key Asc id
idx_data_permissions_db_id Performance Asc db_id
idx_data_permissions_group_id Performance Asc group_id
idx_data_permissions_group_id_db_id_perm_value Performance Asc/Asc/Asc group_id + db_id + perm_value
idx_data_permissions_group_id_db_id_table_id_perm_value Performance Asc/Asc/Asc/Asc group_id + db_id + table_id + perm_value
idx_data_permissions_table_id Performance Asc table_id

Relationships