prisma-dbml-generator icon indicating copy to clipboard operation
prisma-dbml-generator copied to clipboard

manyMany join tables are not generated

Open maxmousse opened this issue 2 years ago • 7 comments

I there,

First thank you for maintaining this prisma generator, it's very useful =)

Problem

I'm reporting this issue cause I am not able to have the manyMany join tables generated

How to reproduce

I am using [email protected].

Here is my prisma schema:

// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider        = "prisma-client-js"
  output          = "./node_modules/.prisma/client"
  previewFeatures = []
}

generator dbml {
  provider   = "prisma-dbml-generator"
  output     = "."
  outputName = "schema.dbml"
  manyToMany = true
  includeRelationFields = false
  projectDatabaseType = "postgreSQL"
}


model MarketZone {
  id          String    @id @default(uuid())
  name        String
  description String

  // Relations
  marketActors MarketActor[]
}

model MarketActor {
  id          String    @id @default(uuid())
  name        String
  marketActorTypeId String

  marketZones  MarketZone[]
}

and here is the generator output:

//// ------------------------------------------------------
//// THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
//// ------------------------------------------------------

Table MarketZone {
  id String [pk]
  name String [not null]
  description String [not null]
}

Table MarketActor {
  id String [pk]
  name String [not null]
  marketActorTypeId String [not null]
}

If that's a bug, I'd be happy to help fix it =)

maxmousse avatar Apr 25 '23 15:04 maxmousse