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

Show empire origin #149

Closed
oatmealproblem opened this issue May 13, 2024 · 5 comments · Fixed by #152
Closed

Show empire origin #149

oatmealproblem opened this issue May 13, 2024 · 5 comments · Fixed by #152
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers python Pull requests that update Python code

Comments

@oatmealproblem
Copy link
Collaborator

oatmealproblem commented May 13, 2024

From Stellaris Modding Den Discord:

Request: for the origin to also be displayed with the other country info (civics, ethics, etc)

Technical Notes

The origin is not saved currently, so this will requiring edits to Country in datamodel.py and CountryProcessor.extract_data_from_gamestate in timeline.py.

For displaying the origin, we need to edit EventTemplateDictBuilding.country_details in history_ledger.py

@oatmealproblem oatmealproblem added enhancement New feature or request good first issue Good for newcomers python Pull requests that update Python code labels May 13, 2024
@oatmealproblem oatmealproblem self-assigned this May 13, 2024
@oatmealproblem
Copy link
Collaborator Author

@eliasdoehne is there anything set up for database migrations? I looked but didn't see anything
Otherwise this change causes errors when running on an existing DB; the user either needs to manually edit their SQLite DB, or entirely delete the DB

@eliasdoehne
Copy link
Owner

eliasdoehne commented May 13, 2024

No, I never used migrations. Since there is a separate DB created for each game, I did not consider the database to be a long-term storage. I usually just mentioned in the release notes if a change is breaking the schema so people should finish their current game before upgrading. (often this also coincided with a new DLC/game release, which usually breaks save file compatibility anyway)

(I guess a workaround to this would be reparsing save files with the new release, but it's also not a great solution since Stellaris only keeps a few autosaves)

@oatmealproblem
Copy link
Collaborator Author

Thoughts on setting up alembic (part of the sqlalchemy project) to automatically migrate the DB?

I suspect schema changes will be needed to support things from the past several Stellaris releases, and it would be nice to be able to release those without breaking things

@eliasdoehne
Copy link
Owner

Sounds good! It would be useful to update the schemas in non-breaking releases. I'm not familiar with alembic, but at a glance it looks like a good fit.

@oatmealproblem
Copy link
Collaborator Author

oatmealproblem commented May 13, 2024

I'll write a separate issue for that
edit: here it is #151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers python Pull requests that update Python code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants