Skip to content

Commit

Permalink
Fix: record table add column date_modified (#65)
Browse files Browse the repository at this point in the history
* record table: fixed script to add date_modified column

* added if not exists clause

* formatting

---------

Co-authored-by: Stefano Ricci <[email protected]>
  • Loading branch information
SteRiccio and SteRiccio authored Aug 8, 2023
1 parent 5c0a81d commit 0e8aee4
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ALTER TABLE record
ADD COLUMN date_modified TIMESTAMP NOT NULL DEFAULT (now() AT TIME ZONE 'UTC');
ADD COLUMN IF NOT EXISTS date_modified TIMESTAMP NOT NULL DEFAULT (now() AT TIME ZONE 'UTC');

UPDATE
record r
Expand All @@ -12,5 +12,13 @@ SET
WHERE
node.record_uuid = r.uuid
GROUP BY
node.record_uuid);
node.record_uuid)
WHERE
EXISTS (
SELECT
*
FROM
node
WHERE
node.record_uuid = r.uuid);

0 comments on commit 0e8aee4

Please sign in to comment.