aaemnnosttv / wp-cli-valet-command

Harness the power of Laravel Valet for creating fully functional WordPress installs in seconds.
https://aaemnnost.tv/wp-cli-commands/valet/
299 stars 31 forks source link

Get rid of wp_ db name prefix? #85

Closed fotan closed 2 years ago

fotan commented 2 years ago

Is there some way to get rid of the wp_ database name prefix? Not a huge deal, but it's just annoying enough.

I see the line in config.yml (# dbname: defaults to wpname) but simply removing wp from it give you a db named "name". Is there some way to insert the site name instead?

aaemnnosttv commented 2 years ago

The prefix is only applied to the default dbname, so you can currently provide whatever you want by passing the --dbname=<name> option which would not be prefixed. I wouldn't recommend using the config for this though because then it would try to create every site using the same DB name unless provided in the command.

It sounds like what you are looking for would be a way to configure the prefix used in the default DB name?

fotan commented 2 years ago

Yes. I was hoping I could just add the site name to the option in the config. It wouldn't be horrible to just add --dbname= to the command though, if that's the actual string I need to use.

aaemnnosttv commented 2 years ago

It wouldn't be horrible to just add --dbname= to the command though, if that's the actual string I need to use.

Yes. For example, if you wanted a site my-site with a matching DB name, you would use this command:

wp valet new my-site --dbname=my-site

Obviously the downside is that you're duplicating the name in the command, but this is the way you'd achieve what you are trying to do as things are now.

fotan commented 2 years ago

Ok. That can work. Much appreciated.