mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-03 22:38:10 +08:00
See: https://meta.discourse.org/t/cakeday-plugin-disabled/389830 and the previous commits:3729361c32c02de976fcb10ea7929f
23 lines
413 B
Ruby
23 lines
413 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Migration
|
|
module Helpers
|
|
def self.site_created_at
|
|
result = DB.query_single <<~SQL
|
|
SELECT created_at
|
|
FROM schema_migration_details
|
|
ORDER BY created_at
|
|
LIMIT 1
|
|
SQL
|
|
result.first
|
|
end
|
|
|
|
def self.existing_site?
|
|
site_created_at < 1.hour.ago
|
|
end
|
|
|
|
def self.new_site?
|
|
!existing_site?
|
|
end
|
|
end
|
|
end
|