mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-18 23:55:16 +00:00
single quotes in db migrations
This commit is contained in:
1 parent
658b15d6aa
commit
e0779897b6
5 files changed
+22
-8
No files matched your search
@@ -29,11 +29,18 @@ SECRETS_PATH = "secrets.toml"
|
||||
|
||||
# -- Migration query to run in batches --
|
||||
# Tweak this as needed. Use LIMIT to control batch size.
|
||||
# QUERY = """
|
||||
# delete
|
||||
# from media_files
|
||||
# where maybe_creator_user_token is null
|
||||
# limit 10000
|
||||
# """
|
||||
|
||||
QUERY = """
|
||||
delete
|
||||
from media_files
|
||||
where maybe_creator_user_token is null
|
||||
limit 10000
|
||||
delete from media_files
|
||||
where media_type in ("audio", "wav")
|
||||
and created_at < NOW() - INTERVAL 6 MONTH
|
||||
limit 10000
|
||||
"""
|
||||
|
||||
BATCH_PAUSE_SECONDS = 0.5
|
||||
|
||||
@@ -24,10 +24,17 @@ except ImportError:
|
||||
SECRETS_PATH = "secrets.toml"
|
||||
|
||||
# -- Count query to poll --
|
||||
# QUERY = """
|
||||
# select count(*)
|
||||
# from media_files
|
||||
# where maybe_creator_user_token is null
|
||||
# """
|
||||
|
||||
QUERY = """
|
||||
select count(*)
|
||||
from media_files
|
||||
where maybe_creator_user_token is null
|
||||
where media_type in ("audio", "wav")
|
||||
and created_at < NOW() - INTERVAL 6 MONTH
|
||||
"""
|
||||
|
||||
POLL_INTERVAL_SECONDS = 60
|
||||
|
||||
Reference in new issue
Block a user