Class: Suspenders::ImportDumpGenerator
Instance Method Summary
collapse
default_source_root
Methods included from Actions
#action_mailer_asset_host, #action_mailer_host, #configure_environment, #expand_json, #replace_in_file
Instance Method Details
#copy_script ⇒ Object
5
6
7
8
|
# File 'lib/suspenders/generators/import_dump_generator.rb', line 5
def copy_script
template "bin_import_dump.erb", "bin/import_dump"
chmod "bin/import_dump", 0o755
end
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/suspenders/generators/import_dump_generator.rb', line 10
def inform_user
instructions = "\n ## Importing a dump from Heroku\n\n If you have configured the heroku remotes successfully,\n you can import a fresh dump from staging or production with:\n\n % ./bin/import_dump staging\n % ./bin/import_dump production\n\n ## Resetting a database\n\n If you want to reset (destroy and recreate) a database on Heroku, you\n cannot use `heroku run rake db:drop`, instead use:\n\n % heroku pg:reset DATABASE_URL --remote=staging\n\n ( source: https://devcenter.heroku.com/articles/heroku-postgresql#pg-reset )\n\n To load schema and seeds, you cannot use `heroku run rake db:setup`, instead use:\n\n % heroku run rails db:schema:load db:seed --remote=staging\n\n Remember to create a new backup schedule on Heroku after you reset your database!\n\n % heroku pg:backups:schedule DATABASE_URL --at '2:00 UTC' --remote=staging\n\n ( source: https://devcenter.heroku.com/articles/heroku-postgres-backups#scheduling-backups )\n\n MARKDOWN\n\n append_file \"README.md\", instructions\nend\n"
|