Arx-Game / arxcode

A text-based/web game using Evennia.
MIT License
45 stars 42 forks source link

Fixed orgs always being treated as taken an action in an episode by c… #467

Closed ApostateCD closed 1 year ago

ApostateCD commented 1 year ago

…reating new episode foreign key

Brief overview of PR changes/additions

Motivation for adding to Arx

Other info (issues closed, discussion etc)

ApostateCD commented 1 year ago

So I added episode to raw_ideal fields and removed the default db_index=true, but I ran into a problem with removing that or behavior in the complex query, and I can't tell if it was the fault of that or something else. I noticed on live sometimes changes we made reverting to different database fields, particularly when we changed in django. Here I've had the foreign_key pointing to an episode in an action sometimes vanishing. This seemed much worse when I had the check for a beat, and I wasn't able to pin down why yet.

When trying to cancel an action on my stage environment, we had the ooc_intent field's foreign key's on_delete behavior not match the schema, which had gone to undefined and made deletes fail. I changed that in sqlite to mirror the model, and I checked production- it works fine there, so it was just a local problem. But what I'm not sure is if randomly sometimes losing data with foreign keys vanishing is in any way related, and since I can't consistently reproduce it yet, I don't have an answer there.

But as long as the foreign keys aren't having any kind of dataloss, the checks work fine.