Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

non-unique indexes are dropped then created on restart #569

Open
AdrienLemaire opened this issue Jan 13, 2021 · 1 comment
Open

non-unique indexes are dropped then created on restart #569

AdrienLemaire opened this issue Jan 13, 2021 · 1 comment

Comments

@AdrienLemaire
Copy link
Contributor

duplicate SO question

Given the schema

type User {
  id: ID! @id
  name: String! @unique
  lastName: String @index
}

When restarting my apollo server, I always see non-unique indexes being dropped and created (indexes for the directive @index).

┌─────────┬─────────────┬────────────┬────────────────┬────────┬───────────┐
│ (index) │    label    │    key     │      keys      │ unique │  action   │
├─────────┼─────────────┼────────────┼────────────────┼────────┼───────────┤
│    0    │   'User'    │ 'lastName' │ [ 'lastName' ] │ false  │ 'DROPPED' │
│    1    │   'User'    │ 'lastName' │ [ 'lastName' ] │ false  │ 'CREATED' │
│   20    │   'User'    │   'name'   │   [ 'name' ]   │  true  │  'KEPT'   │
│   23    │   'User'    │    'id'    │    [ 'id' ]    │  true  │  'KEPT'   │
│   23    │   'User'    │    'id'    │    [ 'id' ]    │  true  │  'KEPT'   │
└─────────┴─────────────┴────────────┴────────────────┴────────┴───────────┘

I'm not sure if that's a bug or by design. In the latter, can someone explain this behavior ?

@michaeldgraham
Copy link
Collaborator

#608

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants