Having lots of problems working with SilverStripe after using namespaces on my custom code. The main problem is the naming convention SilverStripe uses to store namespaced classes:
A DataObject called Product
with a Namespace of MyStore
creates a table called Product\MyStore
. The slash being a rather silly choice in naming convention since it is the escape sequence in MySQL.
The issue now is I am trying to manually drop an obsolete field from a table from the CLI and it is not possble to manually write a query that escapes such a table name.
describe Product\MyStore
describe "Product\MyStore"
describe 'Product\MyStore'
describe "Product\\MyStore"
describe 'Product\\MyStore'
describe Product\\MyStore
Yet this is just fine:
describe SiteTree
I must ask, are namespaces recommended in SilverStripe due to this? I'm very close to ripping all the namespacing out as how it's handled in 3.5 is quite counter-productive.
UPDATE: For future searches, to get around this in CLI you have to wrap the table names in backticks.
describe `Product\MyStore`
Although their use (or reasons that lead to them being used - such as poorly named tables) seems arguable in the MySQL community. I'll leave the question as it may still be valid on the naming convention side of things.