Closed Matt-Crow closed 1 day ago
Multiple DB contexts are causing pain for migrations, might need to do more research or simply write the database creation scripts myself (more likely).
EFCore is having issues finding migrations outside of the public schema.
This is because it executes this query when I run dotnet ef migrations list -c ...
SELECT EXISTS (
SELECT 1 FROM pg_catalog.pg_class c
JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace
WHERE n.nspname='public' AND
c.relname='__EFMigrationsHistory'
)
It does this even when I specify the connection string... but why? This might have something to do with it: https://github.com/npgsql/efcore.pg/issues/2775
Post this somewhere:
I have multiple database contexts, and have one schema for each.
dotnet ef migrations list
doesn't recognize which migrations have been applied, as it always searches the public
schema.
However, dotnet ef database update
creates the migration history table in the schema denoted by the connection string.
Running into issues when saving to the database after loading, maybe EFCore thinks I want to update existing items (I don't). Also need to set item quantity and ID when loading from the DB.
Need refactor!
Done, though I'll have a separate item for refactoring
GameServer