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

Repository: named tables for models #555

Closed
IceKhan13 opened this issue May 16, 2023 · 0 comments · Fixed by #562
Closed

Repository: named tables for models #555

IceKhan13 opened this issue May 16, 2023 · 0 comments · Fixed by #562
Assignees
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers priority: medium Medium priority
Milestone

Comments

@IceKhan13
Copy link
Member

IceKhan13 commented May 16, 2023

What is the expected enhancement?

Gateway and repository has the same application name and same table programs. Therefore migrations in both applications were creating the same table in the same database. Migration passed as it was thinking that those table existed already.

In order to fix this situation we need to have different names for tables for repository and gateway. This can be achieved by providing Meta information for models in repository

Example:

# repository/api/models.py

class Program(models.Model):

    class Meta:
        db_table = "repository_program"

And then migrations must be regenerated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request good first issue Good for newcomers priority: medium Medium priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant