mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Speed up table creation
This commit is contained in:
parent
373b890e1d
commit
28d5bedcc7
1 changed files with 3 additions and 1 deletions
|
@ -501,7 +501,9 @@ end
|
|||
|
||||
def analyze_table(db, logger, table_name, struct_type = nil)
|
||||
# Create table if it doesn't exist
|
||||
if !db.query_one?("SELECT true FROM information_schema.tables WHERE table_name = $1", table_name, as: Bool)
|
||||
begin
|
||||
db.exec("SELECT * FROM #{table_name} LIMIT 0")
|
||||
rescue ex
|
||||
logger.write("CREATE TABLE #{table_name}\n")
|
||||
|
||||
db.using_connection do |conn|
|
||||
|
|
Loading…
Reference in a new issue