Skip to content

Commit

Permalink
Merge pull request #1442 from guardian/ts/remove-snyk-db-tables
Browse files Browse the repository at this point in the history
feat: remove Snyk tables from the database
  • Loading branch information
tjsilver authored Feb 20, 2025
2 parents a5e32b5 + 74c1930 commit ff3ce59
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
BEGIN;

-- Remove the frequency data for deprecated Snyk tables else alarms will trip
DELETE FROM cloudquery_table_frequency
WHERE table_name IN (
'snyk_issues'
, 'snyk_projects'
, 'snyk_sbom'
, 'snyk_organizations'
);

-- Remove deprecated Snyk tables
DROP TABLE IF EXISTS snyk_issues;
DROP TABLE IF EXISTS snyk_projects;
DROP TABLE IF EXISTS snyk_sbom;
DROP TABLE IF EXISTS snyk_organizations;

COMMIT;
25 changes: 0 additions & 25 deletions packages/common/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -557,19 +557,6 @@ model github_workflows {
@@id([org, repository_id, id], map: "github_workflows_cqpk")
}

model snyk_projects {
cq_source_name String? @map("_cq_source_name")
cq_sync_time DateTime? @map("_cq_sync_time") @db.Timestamp(6)
cq_id String @unique @map("_cq_id") @db.Uuid
cq_parent_id String? @map("_cq_parent_id") @db.Uuid
id String @id(map: "snyk_projects_cqpk")
attributes Json?
meta Json?
organization_id String?
relationships Json?
type String?
}

model galaxies_teams_table {
cq_source_name String? @map("_cq_source_name")
cq_sync_time DateTime? @map("_cq_sync_time") @db.Timestamp(6)
Expand Down Expand Up @@ -662,18 +649,6 @@ model repocop_github_repository_rules {
evaluated_on DateTime
}

model snyk_issues {
cq_sync_time DateTime? @map("_cq_sync_time") @db.Timestamp(6)
cq_source_name String? @map("_cq_source_name")
cq_id String @unique @map("_cq_id") @db.Uuid
cq_parent_id String? @map("_cq_parent_id") @db.Uuid
organization_id String?
attributes Json?
id String @id(map: "snyk_issues_cqpk")
relationships Json?
type String?
}

model guardian_github_actions_usage {
evaluated_on DateTime
full_name String
Expand Down

0 comments on commit ff3ce59

Please sign in to comment.