Summary: |
|
|---|
Bug 958: Fix the Postgres database table issues and its relevant code changes device_group and role_device_group
Review Request #372 — Created July 25, 2024 and submitted
| Information | |
|---|---|
| apoorva.sn | |
| AMP | |
| amp_3_7_1 | |
| 958 | |
| Reviewers | |
| pmurugaiyan, prajesh, shuinvy | |
Problem
Fix the Postgres database table issues and its relevant code changes
1.device_group and role_device_group
2. file_type and file_listSolution
Added id column to device_group and make it the primary key for the table
Added new column device_group_id to role_device_group table and make it the foreign key referring to id from device group.
Since the existing entries in the role_device_group will not have any value for device_group_id column added script to populate the value for that column during the upgrade process
Also made similar changes in file_type and file_list as above
Tested the changes and shared screenshots of the tables before and after upgrade
| Description | From | Last Updated |
|---|---|---|
|
Can we call it as update_postgres_dml.py (where we can group all the postgres data releted upgrade changes). As we grow … |
|
|
|
Duplicate code - can we import and reuse the existing DB class from postgres_db.py? |
|
|
|
The SQL queries are expensive here (3 queries) and 2 loops also used. Can we make it as a single … |
|
|
|
Why need the build version in this filename? Can it be similar to postgres_db.py file! |
|
|
|
Nitpick: remove extra spaces (marked red) from all places. |
|
|
|
do we need log in cse of failure ? |
|
-
-
branches/amp_3_7_1/scripts/avxapps_startup.sh (Diff revision 1) Can we call it as update_postgres_dml.py (where we can group all the postgres data releted upgrade changes). As we grow we don't have to maintain individual files for each of those tables.
-
branches/amp_3_7_1/src/webui/webui/htdocs/new/src/cm/upgrade/update_device_group_info.py (Diff revision 1) Duplicate code - can we import and reuse the existing DB class from postgres_db.py?
-
branches/amp_3_7_1/src/webui/webui/htdocs/new/src/cm/upgrade/update_device_group_info.py (Diff revision 1) The SQL queries are expensive here (3 queries) and 2 loops also used. Can we make it as a single query to update the role_device_group table with the help of sub queries?
Description: |
|
|---|
-
-
branches/amp_3_7_1/scripts/avxapps_startup.sh (Diff revision 2) Why need the build version in this filename? Can it be similar to postgres_db.py file!
-
-
branches/amp_3_7_1/src/webui/webui/htdocs/new/src/cm/upgrade/3_7_1/update_db_schema.py (Diff revision 3) Nitpick: remove extra spaces (marked red) from all places.
-
branches/amp_3_7_1/src/webui/webui/htdocs/new/src/cm/upgrade/3_7_1/update_db_schema.py (Diff revision 3) do we need log in cse of failure ?
Diff: |
Revision 4 (+112 -7)
|
|---|
Diff: |
Revision 5 (+112 -7)
|
|---|
