Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new command to auto-generate database table names #162

Closed
madmatt opened this issue Mar 27, 2019 · 3 comments
Closed

Add a new command to auto-generate database table names #162

madmatt opened this issue Mar 27, 2019 · 3 comments

Comments

@madmatt
Copy link
Member

madmatt commented Mar 27, 2019

This could either be a new command, or added on to the upgrade command. For any class that is a descendent of DataObject, automatically add private static $table_name = '<short class name>'; to the top of the class definition.

Seems straightforward enough, and would save a decent chunk of time having to open every PHP file in a project and make a trivial change.

@phptek
Copy link

phptek commented Nov 4, 2019

+100 for this. I spoke to @robbieaverill a few days ago about this on Slack. I still don't understand why a default for $table_name in framewokr itself, wasn't implemented as just using the current class' short name - ostensibly zero difference for devlopers and the database itself when upgrading from 2/3 to 4.

@sunnysideup
Copy link

I reckon by default the table name should be the short class name with the ability of using table_name to override it....

@maxime-rainville
Copy link
Contributor

maxime-rainville commented Nov 6, 2019

Duplicate of #104

@maxime-rainville maxime-rainville marked this as a duplicate of #162 Nov 6, 2019
@maxime-rainville maxime-rainville marked this as a duplicate of #104 Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants