class TokyoMetro::Rake::Rails::Deploy::Heroku::Csv::Command::ImportToPostgresql

PostgreSQL に import する table

Private Instance Methods

optional_setting_of_initializer() click to toggle source
# File lib/tokyo_metro/rake/rails/deploy/heroku/csv/command/import_to_postgresql.rb, line 6
def optional_setting_of_initializer
  @letter_code = "shift_jis"
  @dirname = "#{ ::Rails.root }/db/csv/#{ @time }/#{ @letter_code }"
end
set_commands_for_db() click to toggle source
# File lib/tokyo_metro/rake/rails/deploy/heroku/csv/command/import_to_postgresql.rb, line 16
def set_commands_for_db
  @commands << tables_names_added_to_db.map { | table |
    "\\copy #{ table } from \'#{ @dirname }/#{ table }.csv\' CSV ;"
  }
end
tables_names_added_to_db() click to toggle source

@note 原則は「schema_migrations 以外すべて」

# File lib/tokyo_metro/rake/rails/deploy/heroku/csv/command/import_to_postgresql.rb, line 12
def tables_names_added_to_db
  tables_without_schema_migrations.map( &:to_s )
end