0
0
Ruby on Railsframework~10 mins

Database setup for production in Ruby on Rails - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create the production database in Rails.

Ruby on Rails
rails db:[1] RAILS_ENV=production
Drag options to blanks, or click blank then click option'
Acreate
Brollback
Cseed
Dmigrate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'migrate' before creating the database causes errors.
Using 'seed' tries to add data but the database must exist first.
2fill in blank
medium

Complete the code to apply migrations to the production database.

Ruby on Rails
rails db:[1] RAILS_ENV=production
Drag options to blanks, or click blank then click option'
Arollback
Bseed
Cmigrate
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' again after the database exists is unnecessary.
Using 'rollback' reverses migrations instead of applying them.
3fill in blank
hard

Fix the error in the command to seed the production database.

Ruby on Rails
rails db:[1] RAILS_ENV=production
Drag options to blanks, or click blank then click option'
Amigrate
Brollback
Ccreate
Dseed
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'migrate' tries to change schema, not add data.
Using 'create' tries to make a new database, not add data.
4fill in blank
hard

Fill both blanks to configure the production database adapter and username in config/database.yml.

Ruby on Rails
production:
  adapter: [1]
  username: [2]
Drag options to blanks, or click blank then click option'
Apostgresql
Bmysql2
Croot
Dadmin
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'mysql2' adapter when the project uses PostgreSQL.
Using 'root' username which is less secure for production.
5fill in blank
hard

Fill all three blanks to set the production database host, password, and database name in config/database.yml.

Ruby on Rails
production:
  host: [1]
  password: [2]
  database: [3]
Drag options to blanks, or click blank then click option'
Alocalhost
Bsecurepass123
Cmyapp_production
D127.0.0.1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'localhost' instead of '127.0.0.1' can sometimes cause connection issues.
Using weak or empty passwords.
Using wrong database names that don't match the environment.