1656b7ed01
Some tables in the database have constraints on columns with dates. Because of them, the script for moving timestamps can fail from time to time. This PR makes the script work with such tables. In general, in PostgreSQL it is not always possible to defer constraint checks to the transaction commit (Primary Keys and Unique Constraints can be deferred, but them should be declared as DEFERRABLE to make it possible. Indices created with CREATE UNIQUE INDEX can't be deferred at all). Since we can't defer constraint checks, I've made it work using a little hack. For example, if we need to move all timestamps by one day, the script will move timestamps by 1000 years and one day, and then return timestamps back by 1000 years. The script use this hack only for columns that have unique constraints. |
||
---|---|---|
.. | ||
benchmarks | ||
bulk_import | ||
demon_test | ||
import_scripts | ||
.gitignore | ||
alice.txt | ||
analyze_sidekiq_queues.rb | ||
bench.rb | ||
biggest_objects.rb | ||
boot_mem.rb | ||
cache_critical_dns | ||
check_forking.rb | ||
compile_hbs.rb | ||
copyright-deposit | ||
db_timestamps_mover.rb | ||
diff_heaps.rb | ||
discourse | ||
docker_test.rb | ||
downsize_uploads.rb | ||
i18n_lint.rb | ||
measure.rb | ||
memory-analysis | ||
memstats.rb | ||
micro_bench.rb | ||
mwrap_sidekiq | ||
profile_db_generator.rb | ||
promote_migrations | ||
rails | ||
redis_memory.rb | ||
require_profiler.rb | ||
spawn_backup_restore.rb | ||
switch_container_ruby | ||
test_email_settings.rb | ||
test_hbs_compiler.rb | ||
test_mem.rb | ||
test_memory_leak.rb | ||
test_pretty_text.rb | ||
thread_detective.rb | ||
user_simulator.rb |