Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Summary

Adds the ability to configure custom (granular) deletion policies for posts for specific teams and/or channels. When the daily retention job runs it selectively deletes posts by age based on the configuration.

...

Updates to the global retention policy continues to be managed via the config APIs.

TBD: Does setting EnableMessageDeletion or EnableFileDeletion to false disable all of the policies?

...

Retention Policies

POST /api/v4/retention_policies create a new retention policy.

...

DELETE /api/v4/retention_policies/:policy_id deletes a retention policy.

As a prerequisite one must delete Deleting a RetentionPolicies record also deletes all of the associated RetentionPoliciesChannels and RetentionPoliciesTeams first, otherwise the request is rejected records.

...

GET /api/v4/retention_policies lists all retention policies, including associated teams and channels.

...

Column name

Description

PolicyId

varchar, the RetentionPolicies.Id foreign key

ChannelId

varchar, the Channels.Id foreign key

TBD: Does ChannelId need to be indexed?

RetentionPoliciesTeams table

Column name

Description

PolicyId

varchar, the RetentionPolicies.Id foreign key

TeamId

varchar, the Teams.Id foreign key

TBD: Does TeamId need to be indexed?

Model

  • Rename DataRetentionPolicy to GlobalDataRetentionPolicy

  • Add RetentionPolicy representing a record in the RetentionPolicies table.

  • Add RetentionPolicyChannel representing a record in the RetentionPoliciesChannels table.

  • Add RetentionPolicyTeam representing a record in the RetentionPoliciesTeams table.

Enterprise

Changes to various methods on DataRetentionWorker in data_retention/worker.go are required.

...