Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sleuthkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Sleuthkit
Commits
4e8801b8
Commit
4e8801b8
authored
4 years ago
by
apriestman
Browse files
Options
Downloads
Patches
Plain Diff
Delete merged objects when their target is deleted
parent
3b9280c2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/java/src/org/sleuthkit/datamodel/CaseDatabaseFactory.java
+3
-3
3 additions, 3 deletions
...java/src/org/sleuthkit/datamodel/CaseDatabaseFactory.java
with
3 additions
and
3 deletions
bindings/java/src/org/sleuthkit/datamodel/CaseDatabaseFactory.java
+
3
−
3
View file @
4e8801b8
...
@@ -418,7 +418,7 @@ private void createHostTables(Statement stmt) throws SQLException {
...
@@ -418,7 +418,7 @@ private void createHostTables(Statement stmt) throws SQLException {
+
"person_id INTEGER, "
+
"person_id INTEGER, "
+
"merged_into "
+
dbQueryHelper
.
getBigIntType
()
+
", "
+
"merged_into "
+
dbQueryHelper
.
getBigIntType
()
+
", "
+
"FOREIGN KEY(person_id) REFERENCES tsk_persons(id) ON DELETE SET NULL, "
+
"FOREIGN KEY(person_id) REFERENCES tsk_persons(id) ON DELETE SET NULL, "
+
"FOREIGN KEY(merged_into) REFERENCES tsk_hosts(id) ON DELETE
SET NULL
, "
+
"FOREIGN KEY(merged_into) REFERENCES tsk_hosts(id) ON DELETE
CASCADE
, "
+
"UNIQUE(name)) "
);
+
"UNIQUE(name)) "
);
stmt
.
execute
(
"CREATE TABLE tsk_host_addresses (id "
+
dbQueryHelper
.
getPrimaryKey
()
+
" PRIMARY KEY, "
stmt
.
execute
(
"CREATE TABLE tsk_host_addresses (id "
+
dbQueryHelper
.
getPrimaryKey
()
+
" PRIMARY KEY, "
...
@@ -492,7 +492,7 @@ private void createAccountTables(Statement stmt) throws SQLException {
...
@@ -492,7 +492,7 @@ private void createAccountTables(Statement stmt) throws SQLException {
+
"merged_into "
+
dbQueryHelper
.
getBigIntType
()
+
" DEFAULT NULL, "
+
"merged_into "
+
dbQueryHelper
.
getBigIntType
()
+
" DEFAULT NULL, "
+
"UNIQUE(realm_signature), "
+
"UNIQUE(realm_signature), "
+
"FOREIGN KEY(scope_host_id) REFERENCES tsk_hosts(id) ON DELETE CASCADE,"
+
"FOREIGN KEY(scope_host_id) REFERENCES tsk_hosts(id) ON DELETE CASCADE,"
+
"FOREIGN KEY(merged_into) REFERENCES tsk_os_account_realms(id) ON DELETE
SET NULL
)"
);
+
"FOREIGN KEY(merged_into) REFERENCES tsk_os_account_realms(id) ON DELETE
CASCADE
)"
);
// References tsk_objects, tsk_os_account_realms, tsk_persons
// References tsk_objects, tsk_os_account_realms, tsk_persons
stmt
.
execute
(
"CREATE TABLE tsk_os_accounts (os_account_obj_id "
+
dbQueryHelper
.
getBigIntType
()
+
" PRIMARY KEY, "
stmt
.
execute
(
"CREATE TABLE tsk_os_accounts (os_account_obj_id "
+
dbQueryHelper
.
getBigIntType
()
+
" PRIMARY KEY, "
...
@@ -509,7 +509,7 @@ private void createAccountTables(Statement stmt) throws SQLException {
...
@@ -509,7 +509,7 @@ private void createAccountTables(Statement stmt) throws SQLException {
+
"UNIQUE(signature, realm_id), "
+
"UNIQUE(signature, realm_id), "
+
"FOREIGN KEY(os_account_obj_id) REFERENCES tsk_objects(obj_id) ON DELETE CASCADE, "
+
"FOREIGN KEY(os_account_obj_id) REFERENCES tsk_objects(obj_id) ON DELETE CASCADE, "
+
"FOREIGN KEY(realm_id) REFERENCES tsk_os_account_realms(id) ON DELETE CASCADE,"
+
"FOREIGN KEY(realm_id) REFERENCES tsk_os_account_realms(id) ON DELETE CASCADE,"
+
"FOREIGN KEY(merged_into) REFERENCES tsk_os_accounts(os_account_obj_id) ON DELETE
SET NULL
)"
);
+
"FOREIGN KEY(merged_into) REFERENCES tsk_os_accounts(os_account_obj_id) ON DELETE
CASCADE
)"
);
}
}
// Must be called after createAccountTables() and blackboard_attribute_types, blackboard_artifacts creation.
// Must be called after createAccountTables() and blackboard_attribute_types, blackboard_artifacts creation.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment