globalbibletools / gbt

https://interlinear.globalbibletools.com
15 stars 2 forks source link

refactor: track changes to phrases and glosses #406

Closed arrocke closed 5 months ago

arrocke commented 5 months ago

What has changed

I ended up deviating a bit from the initial design because it made things a littler simpler to implement. Because we don't need to modify the words in a phrase once it is created, we can just track the created and deleted date on the phrase itself. That negates the need for a more complicated event system for glosses since the current system will work just fine with phrase IDs rather than word and language IDs

Connected Issues

closes #384

QA Steps

  1. Run nx run db:prisma migrate dev to update your database with the new schema
  2. Try updating a few glosses to see what happens as phrases and gloss events are created

Post-Deployment

tycebrown commented 5 months ago

@arrocke I'm having trouble migrating the database. I ran pg_restore -f test.sql seed.dump and, based on the generated sql file, it appears that the seed file contains phrase entries with null createdAt fields. Since these phrases are inserted when the db is reseeded (after the prisma migrations are run), wouldn't createdAt field already be required?

If I understand this correctly, I believe the database needs to be reseeded with phrases which already have the createdAt date set.

arrocke commented 5 months ago

woops, thanks for catching that. It should be good now

Pertempto commented 5 months ago

I'll try to review this evening

Pertempto commented 5 months ago

all queries filter out deleted queries

deleted glosses?

Pertempto commented 5 months ago

Ah, deleted phrases.