Skip to main content

seed_default_groups

Function seed_default_groups 

Source
pub async fn seed_default_groups(db: &Db) -> Result<()>
Expand description

Seed the three structural permission groups on a fresh database.

Idempotent: calls create_group (ON CONFLICT (name) DO UPDATE description) for each name. Safe to invoke on every boot.

Guard (PR 2.2 doctrine): the seed is SKIPPED when the rustio_groups table already contains any group name NOT in DEFAULT_GROUP_NAMES. An existing project that has built its own group structure on 0.20.x is never silently re-shaped by upgrading to 0.21.0; only databases that are either fresh or already match the default set get the seed applied.