-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Copy link
Labels
Component: CoreRelates to core serviceRelates to core serviceComponent: DatabaseRelates to database microservice / data modelRelates to database microservice / data modelComponent: RepositoryRelates to repository serviceRelates to repository service
Description
Description
As a database administrator, I want to add a 'type' field to all existing repository documents and ensure new repositories have this field so that the system can distinguish between Globus and metadata-only repositories.
Migration Script Example
// Migration: add_repo_type_field.js
db._query(`
FOR repo IN repo
FILTER \!HAS(repo, 'type')
UPDATE repo WITH { type: 'globus' } IN repo
RETURN NEW
`);
// Validation
const reposWithoutType = db._query(`
FOR repo IN repo
FILTER \!HAS(repo, 'type')
RETURN repo
`).toArray();
if (reposWithoutType.length > 0) {
throw new Error(`Migration failed: ${reposWithoutType.length} repos still missing type field`);
}Rollback Script
// Rollback: remove_repo_type_field.js
db._query(`
FOR repo IN repo
UPDATE repo WITH { type: null } IN repo
OPTIONS { keepNull: false }
RETURN NEW
`);Acceptance Criteria
- Create migration script to add 'type' field to existing repository documents
- Set default value of 'globus' for all existing repositories
- Ensure migration is idempotent (can be run multiple times safely)
- Create rollback script to remove type field if needed
- Validate that all repositories have a type field after migration
- Update any database indexes that might be affected
- Test migration on a copy of production data
- Document migration procedure and rollback steps
Resources
- Engineering Design Document: spec.md - Data Model Impact section
- Repository collection: ArangoDB 'repo' collection
- Migration approach from spec:
{ "filter": { "type": { "": false } }, "update": { "": { "type": "globus" } } }
Dependencies
- Depends on: Foxx API Updates ([Foxx] Foxx API Updates: Update Repository and Allocation Endpoints for Type Support #1515)
- Should be run during maintenance window
Metadata
Metadata
Assignees
Labels
Component: CoreRelates to core serviceRelates to core serviceComponent: DatabaseRelates to database microservice / data modelRelates to database microservice / data modelComponent: RepositoryRelates to repository serviceRelates to repository service