So, I have two DB models, one for the main database and the second for the tentant DB. The tenant model loads a variable wich contains the identifier of the requested tenant, so It should create the sqlite file and generate the migrations files.
My problem is that I want specific migrations files per database, not the same .table files for every sqlite db. So, I'm trying (whitout success) to generate the migration files inside the tenants folders. The sqlite db is created without problems, but the following example does not:
In the tenant model:
os.path.join(request.folder, 'databases', 'clients', 'client_{0}'.format(tenant))
con='sqlite://' + os.path.join(
request.folder, 'databases', 'clients', 'client_{0}'.format(tenant))def migration(table):
return '{0}/{1}.table'.format(tenant_folder, table)
#In the tables definitions
...
migrate=migration('buildings')