I have a schema defined for each customer with schema name as {customer_name}. I have a table named customer_config for each customer schema. Now my problem is I am using restfullyii and I need to define relation between the customer schema and {customer_name}.customer_config as I want to use customer_config as a sub-resource under CustomerController class. I do not have any foreign key in {customer_name}.customer_config table and I cannot define one either. Please help me with this.
Because we generate schema based on customer names hence customer_config is already under that particular customer’s schema. Also I am not allowed to change table structure. So I do not have an option of adding FK.
For e.g. lets say customer name is ‘xyz’. Then a schema named ‘xyz’ is automatically created for this customer and all the required tables are placed under this schema. So whenever I want to select all the rows in ‘customer_config’ table of customer ‘xyz’, I will query something like this ‘select * from xyz.customer_config;’
Now the problem is as customer_config is a subresource of customer I want to access this using URL ‘<domain>/customer/xyz/customer_config’. But since there is no relation defined restfullyii is not decoding this URL.