Skip to content

Commit

Permalink
Create PrivacyBucketAcdpCharges table schema for ACDP composition (#1121
Browse files Browse the repository at this point in the history
)
  • Loading branch information
iverson52000 authored Jul 26, 2023
1 parent 406bab0 commit 8d19b39
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,25 @@ CREATE TABLE PrivacyBucketCharges(
PRIMARY KEY (MeasurementConsumerId, Date, AgeGroup, Gender, VidStart, Delta, Epsilon)
);

CREATE TABLE PrivacyBucketAcdpCharges(
-- Which Measurement Consumer this PrivacyBucket belongs to.
MeasurementConsumerId text NOT NULL,
-- Day for this PrivacyBucket. DD-MM-YYYY.
Date Date NOT NULL,
-- Age for this PrivacyBucket.
AgeGroup AgeGroup NOT NULL,
-- Gender for this PrivacyBucket.
Gender Gender NOT NULL,
-- Start of the Vid range for this PrivacyBucket. Bucket vid's ranges from VidStart to VidStart + 0.1.
VidStart real NOT NULL,
-- Rho for the AcdpCharge of this ledger entry.
Rho real NOT NULL,
-- Theta for the AcdpCharge of this ledger entry.
Theta real NOT NULL,
-- Used to query entries efficiently to update rho and theta.
PRIMARY KEY (MeasurementConsumerId, Date, AgeGroup, Gender, VidStart)
);

CREATE TABLE LedgerEntries(
-- Which Measurement Consumer this Ledger Entry belongs to.
MeasurementConsumerId text NOT NULL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class PostgresBackingStoreTest : AbstractPrivacyBudgetLedgerStoreTest() {
"""
DROP TABLE IF EXISTS LedgerEntries CASCADE;
DROP TABLE IF EXISTS PrivacyBucketCharges CASCADE;
DROP TABLE IF EXISTS PrivacyBucketAcdpCharges CASCADE;
DROP TYPE IF EXISTS Gender CASCADE;
DROP TYPE IF EXISTS AgeGroup CASCADE;
"""
Expand Down

0 comments on commit 8d19b39

Please sign in to comment.