-
Notifications
You must be signed in to change notification settings - Fork 118
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
missing types #1090
Comments
Removed all the enums and now it generates with out errors. The question is though that the docs state the enums are somewhat supported, what kind of enums are supported, the above seems like a simple enum type? |
Hey @sansavision. Can you share the Postgres view of the table and the enum type? I.e. the output of running It would also be helpful to see the contents of the
|
We have a few tables for which the generated type is missing, we are using the latest version of electric-sql 0.9.6 and downgraded prisma to 4.8.1
Here is one of the affected prisma models
enum AttachmentType {
DOCUMENT
WEBSITE
IMAGE
ARTICLE
PROFILE
RESUME
PROJECT
OTHER
}
model Bibliography {
id String @id @default(cuid())
name String
url String
doiID String
abstract String?
type AttachmentType
projectID String
project Project @relation(fields: [projectID], references: [id], onDelete: Cascade)
@@Index([projectID])
}
here is the schema that is generated with debug mode when generating for the same model, note that "type" is Unsupported even though its a enum
enum AttachmentType {
DOCUMENT
WEBSITE
IMAGE
ARTICLE
PROFILE
RESUME
PROJECT
OTHER
}
model Bibliography {
id String @id
name String
url String
doiID String
abstract String?
type Unsupported("public.AttachmentType")
projectID String
@@Index([projectID])
@@Map("Bibliography")
}
here is the respective migration
CREATE TABLE "AttachmentResource" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"url" TEXT NOT NULL,
"description" TEXT,
"type" TEXT NOT NULL,
"projectActivityLogID" TEXT NOT NULL,
CONSTRAINT "AttachmentResource_pkey" PRIMARY KEY ("id")
) WITHOUT ROWID;
CREATE INDEX "AttachmentResource_projectActivityLogID_idx" ON "AttachmentResource" ("projectActivityLogID" ASC);
CREATE TABLE "Bibliography" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"url" TEXT NOT NULL,
"doiID" TEXT NOT NULL,
"abstract" TEXT,
"type" TEXT NOT NULL,
"projectID" TEXT NOT NULL,
CONSTRAINT "Bibliography_pkey" PRIMARY KEY ("id")
) WITHOUT ROWID;
CREATE INDEX "Bibliography_projectID_idx" ON "Bibliography" ("projectID" ASC);
Lastly here is the content generated (src/generated)
Bibliography: {
fields: new Map([
[
"id",
"TEXT"
],
[
"name",
"TEXT"
],
[
"url",
"TEXT"
],
[
"doiID",
"TEXT"
],
[
"abstract",
"TEXT"
],
[
"projectID",
"TEXT"
]
]),
relations: [
],
modelSchema: (BibliographyCreateInputSchema as any)
.partial()
.or((BibliographyUncheckedCreateInputSchema as any).partial()),
createSchema: BibliographyCreateArgsSchema,
createManySchema: BibliographyCreateManyArgsSchema,
findUniqueSchema: BibliographyFindUniqueArgsSchema,
findSchema: BibliographyFindFirstArgsSchema,
updateSchema: BibliographyUpdateArgsSchema,
updateManySchema: BibliographyUpdateManyArgsSchema,
upsertSchema: BibliographyUpsertArgsSchema,
deleteSchema: BibliographyDeleteArgsSchema,
deleteManySchema: BibliographyDeleteManyArgsSchema
} as TableSchema<
z.infer,
Prisma.BibliographyCreateArgs['data'],
Prisma.BibliographyUpdateArgs['data'],
Prisma.BibliographyFindFirstArgs['select'],
Prisma.BibliographyFindFirstArgs['where'],
Prisma.BibliographyFindUniqueArgs['where'],
never,
Prisma.BibliographyFindFirstArgs['orderBy'],
Prisma.BibliographyScalarFieldEnum,
BibliographyGetPayload
Where the following was not generated
BibliographyCreateInputSchema
BibliographyUncheckedCreateInputSchema
BibliographyCreateArgsSchema
BibliographyCreateManyArgsSchema
BibliographyUpsertArgsSchema
BibliographyCreateInputSchema
BibliographyCreateArgs
whilst the rest was generated
I suspect that this has to do with the enum type, but as i understand you support user defined enums ?
The text was updated successfully, but these errors were encountered: