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

Sql server initialize #3374

Closed
reubenelder opened this issue Jun 26, 2023 · 13 comments
Closed

Sql server initialize #3374

reubenelder opened this issue Jun 26, 2023 · 13 comments
Labels
Question Issue is a question? Review Tag for PM/Dev Review

Comments

@reubenelder
Copy link

reubenelder commented Jun 26, 2023

Hi,

We use the OSS Fhir server and are just working through and improving our upgrade process. According to the documentation for production we should use the schema-manager tool for upgrading the database schema. This seems to work nicely however I just have a couple of questions.

Do we need to have the SqlServer:Initialize flag set to true if we upgrade the schema via the tool - what exactly does this flag do (in the code it says it brings the schema to the minimum supported version - but won't the tool do that)?

And based on the documentation we update the website code first and then update the schema. I presume this means that website updates are backwards compatible with previous versions of the schema, is that correct (i.e. in between web updates and schema updates)?

Thanks for your help,
Reuben

AB#104793

@reubenelder reubenelder added the Question Issue is a question? label Jun 26, 2023
@reubenelder
Copy link
Author

Hi, just wondering if anyone has some advice on this? thanks

@EXPEkesheth
Copy link
Collaborator

@apurvabhaleMS - Can you please help with questions above?

@EXPEkesheth EXPEkesheth added the Review Tag for PM/Dev Review label Jul 17, 2023
@apurvabhaleMS
Copy link
Contributor

If SqlServer:Initialize flag set to true then the database will be created and base schema will be applied depending upon other flag settings when running the FHIR service. If database is already created and if Initialize flag is set to true along with AutomaticUpdatesEnabled then on restart of the service the latest schema will be applied.

Database exists and Schema upgrade via service
Initialize = true
AutomaticUpdatesEnabled = true

Database exists and Schema upgrade via schema-manager tool
Initialize = true/false (Not considered)
AutomaticUpdatesEnabled = false

Our code is generally backward compatible. If we are releasing any breaking change then we update the SchemaVersionConstant.Min value. This indicates that SchemaVersionConstant.Min schema version is required to run the FHIR service.

@reubenelder
Copy link
Author

Excellent - thanks very much for the info. Much appreciated.

@reubenelder
Copy link
Author

@apurvabhaleMS just a quick follow up on this - in a lot of the recent releases the min and max in the SchemaVersionConstant file are the same. If that is the case how can you update with the schema update tool, which if I understand correctly requires the website to be updated first which presumably won't work because the schema hasn't been updated and it is looking for that minimum version?

@EXPEkesheth
Copy link
Collaborator

@reubenelder - Yes you will be needed to deploy the schema script prior to deploying the latest FHIR OSS code. This should help address the concern for now. We are working on documenting the guidance. Once we have it documented, will inform.

@reubenelder
Copy link
Author

thanks @EXPEkesheth - how exactly do you do that as my understanding is that the upgrade tool gets the schema update scripts from the website? And if you update the schema first, will the website still work before it is upgraded?

@EXPEkesheth
Copy link
Collaborator

@reubenelder - The schema scripts are now embedded in the FHIR Schema Manager tool (Reference: fhir-server/src/Microsoft.Health.Fhir.SchemaManager at main · microsoft/fhir-server (github.com)).

@reubenelder
Copy link
Author

Excellent - thanks @EXPEkesheth . And if we update the database schema will the FHIR OSS service be able to handle the new schema updates before it is updated? i.e. it sounds like we update the schema and then update the container image. Just wanting to make sure that everything will work while the schema is being updated before the OSS image is updated.

@EXPEkesheth
Copy link
Collaborator

@reubenelder -Schema first should work . Can you please provide us the schema version and code version you are on? This will help us with responding concretely.

@reubenelder
Copy link
Author

thanks @EXPEkesheth - currently we are on 3.4.214 and schema version 58. Our current upgrade process is to go one release version at a time when upgrading.

@EXPEkesheth
Copy link
Collaborator

@reubenelder Your current FHIR version and Schema version is in Sync. Note we are actively making changes which would be backward compatible with the code like how it was in the past.

@EXPEkesheth
Copy link
Collaborator

@reubenelder - Closing the issue as it answered. We would like to invite you to participate in FHIR service usage poll : #3504, please provide your input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Issue is a question? Review Tag for PM/Dev Review
Projects
None yet
Development

No branches or pull requests

3 participants