diff options
Diffstat (limited to 'policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0160-pk_pdpstatistics.sql')
-rw-r--r-- | policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0160-pk_pdpstatistics.sql | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0160-pk_pdpstatistics.sql b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0160-pk_pdpstatistics.sql index e0987223..b8a96b68 100644 --- a/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0160-pk_pdpstatistics.sql +++ b/policy-db-migrator/src/main/docker/config/policyadmin/sql/0900/upgrade/0160-pk_pdpstatistics.sql @@ -17,4 +17,6 @@ * ============LICENSE_END========================================================= */ +UPDATE pdpstatistics as p JOIN (SELECT name, version, timeStamp, ROW_NUMBER() OVER (ORDER BY timeStamp ASC) AS row_num FROM pdpstatistics GROUP BY name, version, timeStamp) AS t ON (p.name=t.name AND p.version=t.version AND p.timeStamp = t.timeStamp) SET p.id=t.row_num; + ALTER TABLE pdpstatistics ADD CONSTRAINT PK_PDPSTATISTICS PRIMARY KEY (ID, name, version); |