Skip to content

Commit d6da2cf

Browse files
committed
feat(itam): Add model Software to migrate for history and notes
ref: #823 #820
1 parent ecc544c commit d6da2cf

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

app/core/signal/centurion_model_migrate.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ def centurion_model_migrate(sender, **kwargs):
136136
'model_name': 'OperatingSystemVersion',
137137
'history_model_name': 'OperatingSystemVersionHistory',
138138
'notes_model_name': 'OperatingSystemVersionNotes'
139+
},
140+
{
141+
'app_label': 'itam',
142+
'model_name': 'Software',
143+
'history_model_name': 'SoftwareHistory',
144+
'notes_model_name': 'SoftwareNotes'
139145
}
140146
]
141147

app/fixtures/fresh_db.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ CREATE TABLE IF NOT EXISTS "devops_git_group_history" ("modelhistory_ptr_id" int
114114
CREATE TABLE IF NOT EXISTS "devops_github_repository_notes" ("modelnotes_ptr_id" integer NOT NULL PRIMARY KEY REFERENCES "core_model_notes" ("id") DEFERRABLE INITIALLY DEFERRED, "model_id" integer NOT NULL REFERENCES "devops_githubrepository" ("gitrepository_ptr_id") DEFERRABLE INITIALLY DEFERRED);
115115
CREATE TABLE IF NOT EXISTS "devops_gitlab_repository_notes" ("modelnotes_ptr_id" integer NOT NULL PRIMARY KEY REFERENCES "core_model_notes" ("id") DEFERRABLE INITIALLY DEFERRED, "model_id" integer NOT NULL REFERENCES "devops_gitlabrepository" ("gitrepository_ptr_id") DEFERRABLE INITIALLY DEFERRED);
116116
CREATE TABLE IF NOT EXISTS "devops_git_group_notes" ("modelnotes_ptr_id" integer NOT NULL PRIMARY KEY REFERENCES "core_model_notes" ("id") DEFERRABLE INITIALLY DEFERRED, "model_id" integer NOT NULL REFERENCES "devops_gitgroup" ("id") DEFERRABLE INITIALLY DEFERRED);
117-
CREATE TABLE IF NOT EXISTS "access_organization_history" ("modelhistory_ptr_id" integer NOT NULL PRIMARY KEY REFERENCES "core_model_history" ("id") DEFERRABLE INITIALLY DEFERRED, "model_id" integer NOT NULL REFERENCES "access_tenant" ("id") DEFERRABLE INITIALLY DEFERRED);
118117
CREATE TABLE IF NOT EXISTS "access_organization_notes" ("modelnotes_ptr_id" integer NOT NULL PRIMARY KEY REFERENCES "core_model_notes" ("id") DEFERRABLE INITIALLY DEFERRED, "model_id" integer NOT NULL REFERENCES "access_tenant" ("id") DEFERRABLE INITIALLY DEFERRED);
119-
CREATE TABLE IF NOT EXISTS "settings_usersettings" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "created" datetime NOT NULL, "modified" datetime NOT NULL, "default_organization_id" integer NULL REFERENCES "access_tenant" ("id") DEFERRABLE INITIALLY DEFERRED, "user_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED, "timezone" varchar(32) NOT NULL, "browser_mode" integer NOT NULL);
118+
CREATE TABLE IF NOT EXISTS "access_organization_history" ("modelhistory_ptr_id" integer NOT NULL PRIMARY KEY REFERENCES "core_model_history" ("id") DEFERRABLE INITIALLY DEFERRED, "model_id" integer NOT NULL REFERENCES "access_tenant" ("id") DEFERRABLE INITIALLY DEFERRED);
120119
CREATE TABLE IF NOT EXISTS "settings_appsettings" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "created" datetime NOT NULL, "modified" datetime NOT NULL, "device_model_is_global" bool NOT NULL, "device_type_is_global" bool NOT NULL, "manufacturer_is_global" bool NOT NULL, "software_is_global" bool NOT NULL, "software_categories_is_global" bool NOT NULL, "global_organization_id" integer NULL REFERENCES "access_tenant" ("id") DEFERRABLE INITIALLY DEFERRED, "owner_organization_id" integer NULL REFERENCES "access_tenant" ("id") DEFERRABLE INITIALLY DEFERRED);
120+
CREATE TABLE IF NOT EXISTS "settings_usersettings" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "created" datetime NOT NULL, "modified" datetime NOT NULL, "default_organization_id" integer NULL REFERENCES "access_tenant" ("id") DEFERRABLE INITIALLY DEFERRED, "user_id" integer NOT NULL REFERENCES "auth_user" ("id") DEFERRABLE INITIALLY DEFERRED, "timezone" varchar(32) NOT NULL, "browser_mode" integer NOT NULL);
121121
CREATE TABLE IF NOT EXISTS "access_company" ("entity_ptr_id" integer NOT NULL PRIMARY KEY REFERENCES "access_entity" ("id") DEFERRABLE INITIALLY DEFERRED, "name" varchar(80) NOT NULL);
122122
CREATE TABLE IF NOT EXISTS "access_entity" ("is_global" bool NOT NULL, "model_notes" text NULL, "id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "created" datetime NOT NULL, "modified" datetime NOT NULL, "organization_id" integer NOT NULL REFERENCES "access_tenant" ("id") DEFERRABLE INITIALLY DEFERRED, "entity_type" varchar(30) NOT NULL);
123123
CREATE TABLE IF NOT EXISTS "access_person" ("entity_ptr_id" integer NOT NULL PRIMARY KEY REFERENCES "access_entity" ("id") DEFERRABLE INITIALLY DEFERRED, "f_name" varchar(64) NOT NULL, "l_name" varchar(64) NOT NULL, "dob" date NULL, "m_name" varchar(100) NULL);
@@ -227,8 +227,8 @@ INSERT INTO sqlite_sequence VALUES('core_ticketlinkeditem',0);
227227
INSERT INTO sqlite_sequence VALUES('itam_softwarecategory',0);
228228
INSERT INTO sqlite_sequence VALUES('itam_softwareversion',0);
229229
INSERT INTO sqlite_sequence VALUES('settings_externallink',0);
230-
INSERT INTO sqlite_sequence VALUES('settings_usersettings',0);
231230
INSERT INTO sqlite_sequence VALUES('settings_appsettings',1);
231+
INSERT INTO sqlite_sequence VALUES('settings_usersettings',0);
232232
INSERT INTO sqlite_sequence VALUES('access_entity',0);
233233
INSERT INTO sqlite_sequence VALUES('core_ticketbase',0);
234234
INSERT INTO sqlite_sequence VALUES('core_ticketcommentbase',0);

0 commit comments

Comments
 (0)