Skip to content

Commit 4897ff1

Browse files
populate default values in lineage_events.created_at column
Signed-off-by: Prachi Mishra <prachi.mishra@astronomer.io>
1 parent 69ef361 commit 4897ff1

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

api/src/main/resources/marquez/db/migration/V52__lineage_events_created_at_indexed.sql

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ALTER TABLE lineage_events ADD created_at TIMESTAMP;
2+
3+
create index lineage_events_created_at_index on lineage_events (created_at desc);
4+
5+
UPDATE lineage_events
6+
SET created_at = (event_time AT TIME ZONE 'UTC')::timestamp;
7+
8+
ALTER TABLE lineage_events ALTER COLUMN created_at SET DEFAULT (now() AT TIME ZONE 'UTC');
9+

0 commit comments

Comments
 (0)