mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 17:36:21 +08:00
Ignore delay when first migration was < 10min ago
This commit is contained in:
@ -33,7 +33,12 @@ module Migration
|
||||
SELECT 1
|
||||
FROM schema_migration_details
|
||||
WHERE name = :after_migration AND
|
||||
created_at <= (current_timestamp AT TIME ZONE 'UTC' - INTERVAL :delay)
|
||||
(created_at <= (current_timestamp AT TIME ZONE 'UTC' - INTERVAL :delay) OR
|
||||
(SELECT created_at
|
||||
FROM schema_migration_details
|
||||
ORDER BY id ASC
|
||||
LIMIT 1) > (current_timestamp AT TIME ZONE 'UTC' - INTERVAL '10 minutes')
|
||||
)
|
||||
)
|
||||
SQL
|
||||
end
|
||||
|
Reference in New Issue
Block a user