Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

purge status events #232

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

purge status events #232

wants to merge 1 commit into from

Conversation

skeeey
Copy link
Contributor

@skeeey skeeey commented Dec 17, 2024

No description provided.

@skeeey
Copy link
Contributor Author

skeeey commented Dec 17, 2024

/cc @morvencao @clyang82 @qiujian16

@@ -22,7 +22,7 @@ func addConsumers() *gormigrate.Migration {
}

if err := CreateFK(tx, fkMigration{
"resources", "consumers", "consumer_name", "consumers(name)",
"resources", "consumers", "consumer_name", "consumers(name)", "ON DELETE RESTRICT ON UPDATE RESTRICT",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from SRE comments, we can't modify existing migrations, we need to create new migration to ensure their data can migrated to new schema.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will not effect the db, the change due to refact the CreateFK (make it can support configing constrains )

For the event-instances part, I create a new migration to ensure the db update

@clyang82
Copy link
Contributor

/ok-to-test

@@ -136,6 +136,10 @@ func (d *instanceDaoMock) FindByUpdatedTime(ctx context.Context, updatedTime tim
return instances, nil
}

func (d *instanceDaoMock) FindReadyIDs(ctx context.Context) ([]string, error) {
return []string{}, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can check if instance Ready == true from instances list, instead of return empty slice. this is useful for testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

"event_instances", "server_instances", "instance_id", "server_instances(id)", "ON DELETE CASCADE",
}, fkMigration{
"event_instances", "status_events", "event_id", "status_events(id)", "ON DELETE CASCADE",
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would you alse add foreign key for spec_event_id on events table?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@clyang82
Copy link
Contributor

/ok-to-test

@clyang82
Copy link
Contributor

/ok-to-test

@clyang82
Copy link
Contributor

/ok-to-test

Signed-off-by: Wei Liu <[email protected]>
@clyang82
Copy link
Contributor

/ok-to-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants