SDL generation bug with directus tables

Hi.
I’m managing my Postgres database with directus as well as prisma and redwood.
the procedure resulting in the problem is as follows:

  1. directus and prisma are in sync and everybody is happy.
  2. I create a new table (Article) with directus (which has a relation to the directus files table directus_files )
  3. I run yarn rw prisma db pull to get the newly created table in prisma.schema. it runs successfully :smile:
model Article {
  id              Int      @id @default(autoincrement())
  title           String   @db.VarChar(255)
  image           String?  @db.Uuid
  body            String
  status          String   @default("DRAFT")
  original_author String   @db.Uuid
  creation_date   DateTime @db.Timestamptz(6)
  latest_author   String   @db.Uuid
  date            DateTime @db.Timestamptz(6)

  directus_files                                         directus_files? @relation(fields: [image], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "article_image_foreign")
  directus_users_Article_latest_authorTodirectus_users   directus_users  @relation("Article_latest_authorTodirectus_users", fields: [latest_author], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "article_latest_author_foreign")
  directus_users_Article_original_authorTodirectus_users directus_users  @relation("Article_original_authorTodirectus_users", fields: [original_author], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "article_original_author_foreign")
}
  1. I run yarn rw g sdl Article to create graphql type and resolvers for my new table and get :
yarn rw g sdl Article
  × Generating SDL files...
    → No schema definition found for `directus_files` in schema.prisma file
    Generating types ...
No schema definition found for `directus_files` in schema.prisma file

but directus_files is clearly present in the schema.prisma file :

model directus_files {
  id                                                                    String              @id @db.Uuid
  storage                                                               String              @db.VarChar(255)
  filename_disk                                                         String?             @db.VarChar(255)
  filename_download                                                     String              @db.VarChar(255)
  title                                                                 String?             @db.VarChar(255)
  type                                                                  String?             @db.VarChar(255)
  folder                                                                String?             @db.Uuid
  uploaded_by                                                           String?             @db.Uuid
  uploaded_on                                                           DateTime            @default(now()) @db.Timestamptz(6)
  modified_by                                                           String?             @db.Uuid
  modified_on                                                           DateTime            @default(now()) @db.Timestamptz(6)
  charset                                                               String?             @db.VarChar(50)
  filesize                                                              BigInt?
  width                                                                 Int?
  height                                                                Int?
  duration                                                              Int?
  embed                                                                 String?             @db.VarChar(200)
  description                                                           String?
  location                                                              String?
  tags                                                                  String?
  metadata                                                              Json?               @db.Json
  directus_folders                                                      directus_folders?   @relation(fields: [folder], references: [id], onUpdate: NoAction, map: "directus_files_folder_foreign")
  directus_users_directus_files_modified_byTodirectus_users             directus_users?     @relation("directus_files_modified_byTodirectus_users", fields: [modified_by], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "directus_files_modified_by_foreign")
  directus_users_directus_files_uploaded_byTodirectus_users             directus_users?     @relation("directus_files_uploaded_byTodirectus_users", fields: [uploaded_by], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "directus_files_uploaded_by_foreign")
  Article                                                               Article[]
  Content                                                               Content[]
  directus_settings_directus_filesTodirectus_settings_project_logo      directus_settings[] @relation("directus_filesTodirectus_settings_project_logo")
  directus_settings_directus_filesTodirectus_settings_public_background directus_settings[] @relation("directus_filesTodirectus_settings_public_background")
  directus_settings_directus_filesTodirectus_settings_public_foreground directus_settings[] @relation("directus_filesTodirectus_settings_public_foreground")
}

Is anybody else having this issue too?

Have you tried commenting out the relationships between them, generating them individually. Then commenting back on the relationships and then doing a generate sdl —force ?