Commit f11d70c3 authored by pbair's avatar pbair

Remove explicit cast from index condition

Remove an explicit cast from an index condition which casts the compared
value to `timestamp with time zone`. Some installations could have the
`created_at` column as a `timestamp without time zone`, which causes
index creation to fail.

By removing the explicit cast, postgres casts the timestamp expression
to the appropriate timestamp type.
parent 969e92bc
...@@ -4,7 +4,7 @@ class AddIndexOnEventsUsingBtreeCreatedAtId < Gitlab::Database::Migration[1.0] ...@@ -4,7 +4,7 @@ class AddIndexOnEventsUsingBtreeCreatedAtId < Gitlab::Database::Migration[1.0]
INDEX_NAME = 'index_events_on_created_at_and_id' INDEX_NAME = 'index_events_on_created_at_and_id'
TABLE = :events TABLE = :events
COLUMNS = %i[created_at id] COLUMNS = %i[created_at id]
CONSTRAINTS = "created_at > '2021-08-27 00:00:00+00'::timestamp with time zone" CONSTRAINTS = "created_at > '2021-08-27 00:00:00+00'"
disable_ddl_transaction! disable_ddl_transaction!
def up def up
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment