Project

General

Profile

Patch #41954 » 0006-Support-configurable-skip-tables.patch

Ko Nagase, 2024-12-13 09:24

View differences:

lib/tasks/extract_fixtures.rake
37 37
task :extract_fixtures => :environment do
38 38
  dir = ENV['DIR'] || './tmp/fixtures'
39 39
  time_offset = ENV['TIME_OFFSET'] || ''
40
  skip_tables = ENV['SKIP_TABLES']&.split(',') || []
40 41

  
41 42
  FileUtils.mkdir_p(dir)
42 43
  if time_offset.present? && !time_offset.match?(/^([+-](0[0-9]|1[0-4]):[0-5][0-9])$/)
43 44
    abort("Invalid TIME_OFFSET format. Use +HH:MM or -HH:MM (e.g. +09:00)")
44 45
  end
46
  skip_tables += ["schema_migrations", "ar_internal_metadata"]
45 47

  
46
  skip_tables = ["schema_migrations", "ar_internal_metadata"]
47 48
  ActiveRecord::Base.establish_connection
48 49
  (ActiveRecord::Base.connection.tables - skip_tables).each do |table_name|
49 50
    i = "000"
(8-8/10)