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

Add a table for controls #129

Merged
merged 1 commit into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions migrations/000008_create_controls_table.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE IF EXISTS controls;
9 changes: 9 additions & 0 deletions migrations/000008_create_controls_table.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE IF NOT EXISTS controls (
id uuid PRIMARY KEY,
name VARCHAR(255),
severity VARCHAR(50),
profile_id UUID,
metadata_id UUID,
CONSTRAINT fk_controls_metadata_id FOREIGN KEY (metadata_id) REFERENCES metadata (id),
CONSTRAINT fk_controls_profile_id FOREIGN KEY (profile_id) REFERENCES profiles (id)
);
2 changes: 1 addition & 1 deletion tests/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func TestMigration(t *testing.T) { // nolint:paralleltest // database tests shou
// Upgrade the database and make sure all upgrades apply cleanly.
err = m.Up()
version, dirty, _ = m.Version()
expectedVersion = uint(7)
expectedVersion = uint(8)
assert.Equal(t, expectedVersion, version, "Database version mismatch: want %d but got %d", expectedVersion, version)
assert.Equal(t, false, dirty, "Database state mismatch: want %t but got %t", false, dirty)
assert.Equal(t, err, nil, "Error upgrading the database: %s", err)
Expand Down