You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
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?
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: