Complete the code to add an index on the users table for the email column.
add_index :users, :[1]The add_index method adds an index on the specified column. Here, we want to index the email column.
Complete the code to add a unique index on the username column in the users table.
add_index :users, :username, unique: [1]Setting unique: true ensures that the index enforces uniqueness on the username column.
Fix the error in the code to add a multi-column index on first_name and last_name.
add_index :users, [1]Multi-column indexes require an array of symbols representing the columns.
Fill both blanks to add an index on the orders table for the user_id column with a custom name.
add_index :orders, :[1], name: '[2]'
The index is on the user_id column, and the custom index name is order_user_index.
Fill all three blanks to add a unique index on the email column of the customers table with a custom name.
add_index :customers, :[1], unique: [2], name: '[3]'
This code adds a unique index on the email column with the name unique_email_index.