Remove usage of index_schema_history instead use pg_indexes#244
Remove usage of index_schema_history instead use pg_indexes#244vishalhaven wants to merge 54 commits intohaven-life:masterfrom
Conversation
…rade-with-master-supertype
…idator and remove uuid (haven-life#240) * Updated schema to support ajv * Should fix all tests * Update ajv validation so that we don't compile the schema everycall * Update persistor version in amorphic * Revert amorphic package * Remove uuid * Remove uuid * Fix amorphic package
components/persistor/package.json
Outdated
| "name": "@haventech/persistor", | ||
| "description": "A subclass of supertype that serializes to and reconstitutes from MongoDB or SQL databases", | ||
| "homepage": "https://github.com/haven-life/persistor", | ||
| "version": "12.0.0", |
There was a problem hiding this comment.
Lets point the MR to latest master, which is already published.
Also this would be a feature MR not a bug fix bump.
| "version": "12.0.0", | ||
| "version": "12.0.1", | ||
| "main": "dist/index.js", | ||
| "types": "dist/index.d.ts", |
There was a problem hiding this comment.
Looks like we have a test case failure (pipeline seems to be failing)
can we make sure to add unit tests around:
- no warning message is created if we are deleting an index that is already deleted
- no warning message is created if we insert an index that was already created
- If a new index is added in schema file, then pg_indexes has that index.
- If that same index is deleted from schema file, pg_indexes removes it without impacting any other index
- Create invalid index where column doesn't exist
- update index (valid and invalid case)
- delete index where column is deleted.
Regression:
We would also test regression against some large repo like haven and run their startup.
-
We would need to test above listed scenarios for a blank db (history table empty to mimic fresh db). In a fresh db, history table wont be created. However the pg_indexes initially without the user added indexes, would get populated with the indexes from schema and the ones created by amorphic.
-
Then we would also want to test with an existing history table (uat / prod scenario) that this feature, stops incrementing the rows in history table, and not delete history table or its contents. However, any adds, updates and deletes to indexes are correctly reflecting.
There was a problem hiding this comment.
@kamranHaven I have covered all the scenarios you mention in the comments.
About the regression:
- I have tested with blank db -> works as expected. We need to double the indexes created by the amorphic one.
- Not sure how I should test it. I'll check with the PA repo if there are any changes in the schema/indexes/columns and maybe try to run a startup.
No description provided.