Skip to content

Commit

Permalink
adding NULLS LAST in desc index on lineage_events.created_at
Browse files Browse the repository at this point in the history
Signed-off-by: Prachi Mishra <[email protected]>
  • Loading branch information
prachim-collab committed Dec 12, 2022
1 parent f053ecf commit 53b5cf7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- new column will be created with 'null' filled for existing rows
ALTER TABLE lineage_events ADD created_at TIMESTAMP WITH TIME ZONE;

create index lineage_events_created_at_index on lineage_events (created_at desc);
create index lineage_events_created_at_index on lineage_events (created_at desc NULLS LAST);

-- The new default set to UTC now() will only apply in subsequent INSERT or UPDATE commands; it does not cause rows already in the table to change.
ALTER TABLE lineage_events ALTER COLUMN created_at SET DEFAULT (now() AT TIME ZONE 'UTC')::timestamptz;

0 comments on commit 53b5cf7

Please sign in to comment.