Change table_prefix for wp_config in trellis

I have tried searching for information regarding changing the table prefix on a trellis setup but I have not been able to do so successfully. I have tried placing the following block of code in my wordpress_sites.yml:

env: 
    table_prefix: wp_xyz_

However, when I run vagrant up and check the database structure, the tables are all prefixed with the default wp_

Any assistance or guidance is appreciated.

I notice bedrock’s config/application.php uses
$table_prefix = env('DB_PREFIX') ?: 'wp_';
where the env var is DB_PREFIX, so you might try

  env:
    db_prefix: wp_xyz_
2 Likes

Thank you! I was pulling my hair out trying to figure that out, This worked perfectly.

1 Like