Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Schema from within CollectionDescription #1913

Closed
5 tasks done
Tracked by #1911
AndrewSisley opened this issue Sep 27, 2023 · 0 comments
Closed
5 tasks done
Tracked by #1911

Remove Schema from within CollectionDescription #1913

AndrewSisley opened this issue Sep 27, 2023 · 0 comments
Assignees
Labels
area/collections Related to the collections system refactor This issue specific to or requires *notable* refactoring of existing codebases and components
Milestone

Comments

@AndrewSisley
Copy link
Contributor

AndrewSisley commented Sep 27, 2023

Replace CollectionDescription.Schema with CollectionDescription.SchemaVersionID.

This will require changing a large number (+100) of references, PatchSchema (and tests), and the serialization/ID logic. Try and avoid changing anything else in this ticket.

Tasks

Preview Give feedback
  1. area/collections area/schema refactor
    AndrewSisley
  2. area/schema code quality feature
    AndrewSisley
  3. area/collections area/schema refactor
    AndrewSisley
  4. area/collections area/schema code quality refactor
    AndrewSisley
  5. area/collections code quality
    AndrewSisley
@AndrewSisley AndrewSisley added area/collections Related to the collections system refactor This issue specific to or requires *notable* refactoring of existing codebases and components labels Sep 27, 2023
@AndrewSisley AndrewSisley added this to the DefraDB v0.8 milestone Sep 27, 2023
@AndrewSisley AndrewSisley self-assigned this Sep 27, 2023
AndrewSisley added a commit that referenced this issue Oct 24, 2023
## Relevant issue(s)

Resolves #1964 #1913 

## Description

Reorganises collection description storage so that it actually makes
sense.

The existing key/value setup has been replaced with the following keys:
```
[Collection.ID] => json // Json should be stored against an immutable index, i.e. not against `Name`
[Collection.Name] => [Collection.ID]  // This means collection names must be unique
```
We also need the following for the short-term, before
Collection.GlobalID gets added, as otherwise if a collection is updated
to a new schema version, we lose track of what collection it could be.
The locations that use this have been linked to
#1085
```
[Collection.SchemaVersionId]/[Collection.ID] => nil
```

With this change the storage setup should fully support multiple
collections from a single schema, however this is blocked off by
`setDefaultSchemaVersion` (it doesn't allow users to explicitly specify
a collection, so atm there is no way to try and do this). Later when we
introduce `patchCollection` we will need to be mindful of this and block
off user's ability to do this (if done before #1085).
shahzadlone pushed a commit to shahzadlone/defradb that referenced this issue Feb 23, 2024
## Relevant issue(s)

Resolves sourcenetwork#1964 sourcenetwork#1913 

## Description

Reorganises collection description storage so that it actually makes
sense.

The existing key/value setup has been replaced with the following keys:
```
[Collection.ID] => json // Json should be stored against an immutable index, i.e. not against `Name`
[Collection.Name] => [Collection.ID]  // This means collection names must be unique
```
We also need the following for the short-term, before
Collection.GlobalID gets added, as otherwise if a collection is updated
to a new schema version, we lose track of what collection it could be.
The locations that use this have been linked to
sourcenetwork#1085
```
[Collection.SchemaVersionId]/[Collection.ID] => nil
```

With this change the storage setup should fully support multiple
collections from a single schema, however this is blocked off by
`setDefaultSchemaVersion` (it doesn't allow users to explicitly specify
a collection, so atm there is no way to try and do this). Later when we
introduce `patchCollection` we will need to be mindful of this and block
off user's ability to do this (if done before sourcenetwork#1085).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/collections Related to the collections system refactor This issue specific to or requires *notable* refactoring of existing codebases and components
Projects
None yet
Development

No branches or pull requests

1 participant