Skip to content

Commit

Permalink
chore(backend): change default retention period to 90 days
Browse files Browse the repository at this point in the history
  • Loading branch information
anupcowkur committed Aug 15, 2024
1 parent 00f1b2b commit 43a2e4d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion measure-backend/measure-go/measure/appsettings.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (pref *AppSettings) MarshalJSON() ([]byte, error) {
func newAppSettings(appId uuid.UUID) *AppSettings {
return &AppSettings{
AppId: appId,
RetentionPeriod: 30,
RetentionPeriod: 90,
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
}
Expand Down
4 changes: 2 additions & 2 deletions measure-backend/measure-go/measure/appsettings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ func TestNewAppSettings(t *testing.T) {
if pref.AppId != appId {
t.Errorf("appId mismatch: expected %v, got %v", appId, pref.AppId)
}
if pref.RetentionPeriod != 30 {
t.Errorf("RetentionPeriod mismatch: expected %v, got %v", 30, pref.RetentionPeriod)
if pref.RetentionPeriod != 90 {
t.Errorf("RetentionPeriod mismatch: expected %v, got %v", 90, pref.RetentionPeriod)
}
if pref.CreatedAt.Sub(now) > time.Second {
t.Errorf("createdAt should be around current time")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- migrate:up
create table if not exists public.app_settings (
app_id uuid primary key not null references public.apps(id) on delete cascade,
retention_period int not null default 30,
retention_period int not null default 90,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now()
);
Expand Down
2 changes: 1 addition & 1 deletion self-host/postgres/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ COMMENT ON COLUMN public.api_keys.created_at IS 'utc timestamp at the time of ap

CREATE TABLE public.app_settings (
app_id uuid NOT NULL,
retention_period integer DEFAULT 30 NOT NULL,
retention_period integer DEFAULT 90 NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone DEFAULT now() NOT NULL
);
Expand Down

0 comments on commit 43a2e4d

Please sign in to comment.