discourse/script
Andrei Prigorshnev 696bd0bf05
DEV: add a script for moving timestamps in database (#13682)
We're going to use this script for updating timestamps on Try, but it can be used with a local database during development as well.

Usage:

Commands:
  ruby db_timestamp_updater.rb yesterday <date> move all timestamps by x days so that <date> will be moved to yesterday
  ruby db_timestamp_updater.rb 100              move all timestamps forward by 100 days
  ruby db_timestamp_updater.rb -100             move all timestamps backward by 100 days
The script moves all timestamps in the database by the same amount of days forward or backward. No need to change the script if we add a new column in the future.

The more simple solution would be just to move timestamps in several tables (topics, posts, and so on). I didn't want to go that way because it could generate additional work in the future. For example, if we add a new column with a timestamp and users can see that timestamp we'd need to add that column to the script. Or, for example, if we move a post's timestamp to the future but forget to move a timestamp of topic timer or user action it can cause weird bugs.
2021-07-09 20:04:28 +04:00
..
benchmarks DEV: Correct typos and spelling mistakes (#12812) 2021-05-21 11:43:47 +10:00
bulk_import DEV: Add vBulletin5 bulk importer (#12904) 2021-04-30 11:03:33 -05:00
demon_test
import_scripts FEATURE: Add last visit indication to topic view page. (#13471) 2021-07-05 14:17:31 +08:00
.gitignore
alice.txt
analyze_sidekiq_queues.rb
bench.rb DEV: Update facter usage 2020-06-01 05:50:49 +02:00
biggest_objects.rb
boot_mem.rb
cache_critical_dns DEV: Support env var for prometheus port in cache_critical_dns 2020-08-17 15:48:14 -04:00
check_forking.rb
compile_hbs.rb
copyright-deposit Add script for compiling copyright deposits (#9646) 2020-05-06 12:51:45 -04:00
db_timestamps_mover.rb DEV: add a script for moving timestamps in database (#13682) 2021-07-09 20:04:28 +04:00
diff_heaps.rb
discourse FIX: typo in discourse 2021-06-30 11:08:29 -04:00
docker_test.rb DEV: Remove the remaining Travis code (#13255) 2021-06-02 20:29:47 +02:00
downsize_uploads.rb DEV: Improve `script/downsize_uploads.rb` (#13508) 2021-06-24 00:09:40 +02:00
i18n_lint.rb DEV: Clean up and refactor CI workflow(s) (#12144) 2021-02-22 10:28:32 +01:00
measure.rb
memory-analysis
memstats.rb
micro_bench.rb
mwrap_sidekiq
profile_db_generator.rb
promote_migrations DEV: Update script/promote_migrations (#13513) 2021-06-24 13:57:23 +01:00
rails
redis_memory.rb
require_profiler.rb
spawn_backup_restore.rb FIX: Killing a Unicorn worker shouldn't kill a running backup or restore process 2020-10-13 19:48:53 +02:00
switch_container_ruby
test_email_settings.rb
test_hbs_compiler.rb REFACTOR: Remove `Discourse.__widget_helpers` 2020-08-06 14:35:46 -04:00
test_mem.rb
test_memory_leak.rb
test_pretty_text.rb
thread_detective.rb
user_simulator.rb
version_bump.rb