Error When Applying Migrations Related to Text Indexes

Hello, I am attempting to apply some new migrations, however I am getting the following error when attempting to do so. Any idea why this is? Thanks! Error: DatabaseError: target: hackkit.-.primary: vttablet: BLOB/TEXT column 'presigned_url' used in key specification without a key length (errno 1170) (sqlstate 42000) (CallerID: v6f912c7oc1zkrupmyrv): Sql: "create table files (\n\tpresigned_url text not null,\n\tkey varchar(500) not null,\n\tvalidated boolean not null default false,\n\ttype enum('generic', 'resume') not null,\n\towner_id varchar(255) not null,\n\tconstraint files_presigned_url_unique UNIQUE key (presigned_url),\n\tconstraint files_key_unique UNIQUE key (key)\n)", BindVars: {REDACTED} Section of schema.ts
export const files = mysqlTable("files", {
id: varchar("id", { length: 255 }).notNull().primaryKey().unique(),
presignedURL: text("presigned_url"),
key: varchar("key", { length: 500 }).notNull().unique(),
validated: boolean("validated").notNull().default(false),
type: mysqlEnum("type", ["generic", "resume"]).notNull(),
ownerID: varchar("owner_id", { length: 255 }).notNull(),
});

export const filesRelations = relations(files, ({ one }) => ({
owner: one(users, {
fields: [files.ownerID],
references: [users.clerkID],
}),
}));
export const files = mysqlTable("files", {
id: varchar("id", { length: 255 }).notNull().primaryKey().unique(),
presignedURL: text("presigned_url"),
key: varchar("key", { length: 500 }).notNull().unique(),
validated: boolean("validated").notNull().default(false),
type: mysqlEnum("type", ["generic", "resume"]).notNull(),
ownerID: varchar("owner_id", { length: 255 }).notNull(),
});

export const filesRelations = relations(files, ({ one }) => ({
owner: one(users, {
fields: [files.ownerID],
references: [users.clerkID],
}),
}));
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server