feat(schema): add schema versioning, tracking, diff visualization, and history access#668
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #637
Overview
Implements a complete schema‑versioning subsystem that:
schema_versiontable (checksum‑based deduplication)schema_changetable for every snapshotSchemaChangeDiffobjectsPOST /schema/versions)GET /schema/versions)GET /schema/:id)GET /schema/:id/diff/:previousId)Why
Implementation Details
SchemaVersion,SchemaChangeCreateSchemaVersionDto,GetSchemaDiffDtoSchemaDiffService(pure diff logic)SchemaTrackingService(persistence & retrieval)SchemaControllerwith the above endpoints.SchemaTrackingModule(self‑contained; not imported intoAppModule).SchemaTrackingServiceSchemaControllerroutes.Verification
npm test(unit + e2e) – all pass.curlor Postman to verify each endpoint returns the expected JSON payloads.Staged Commits
entities/*.entity.ts, migration file.dto/*.dto.ts.services/schema-diff.service.ts.services/schema-tracking.service.ts.controllers/schema.controller.ts.modules/schema-tracking.module.ts.tests/schema-tracking.service.spec.ts.tests/schema.controller.e2e-spec.ts.Related Issue
Closes #<ISSUE‑ID> – Track schema changes over time
You can now open the PR with the above title and description. Let me know if any tweaks are needed!