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

Put application tables in schema #201

Merged
merged 12 commits into from
Aug 14, 2024
Merged

Put application tables in schema #201

merged 12 commits into from
Aug 14, 2024

Conversation

Ceredron
Copy link
Collaborator

@Ceredron Ceredron commented Aug 14, 2024

Description

It's best practice to put the tables that belong to our application in its own schema (namespacing). It also makes managing access easier.

We also ensure that both developers and the application has access to Hangfire tables. This is necessary if/when we need to troubleshoot. This also enables us to create a separate Hangfire dashboard application if we see that it is needed.
We can also enable Hangfire dashboard in our main app, but our main app will be blocked from the open internet and ingress will only be allowed through APIM. In theory it should be possible to configure APIM such that it can be used with Hangfire dashboard. But I think it would be harder (especially when we add OIDC login with its re-directs to it).

After this is merged all developers need to wipe their local database. (Delete docker database container, re-run "docker-compose up -d".)

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

@Andreass2
Copy link
Collaborator

When creating new migrations from console, does it use the correct schema automaticly?

Copy link
Collaborator

@Andreass2 Andreass2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Also nice to improve naming of azure resources.

@Ceredron
Copy link
Collaborator Author

When creating new migrations from console, does it use the correct schema automaticly?

Yeah (tested to be safe😅)
It's because of:
modelBuilder.HasDefaultSchema("correspondence");
So all tables created through our DbContext ends up in the correspondence schema.

@Ceredron Ceredron merged commit e3a410e into main Aug 14, 2024
7 checks passed
@Ceredron Ceredron deleted the fix/migration-db-access branch August 14, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants