-
-
Notifications
You must be signed in to change notification settings - Fork 715
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
[BUG]: Missing index names
when running introspect
command [MYSQL]
#2525
Comments
index names
when running introspect
command [MYSQL]index names
when running introspect
command [MYSQL]
This should be fixed in |
Still an issue in BTW, I can't reopen the issue |
can you send me a create statement for your table, so I can reproduce it. Because running tests on names for indexes on introspect was working well for me |
CREATE TABLE `Entity` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=385 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `EntityTag` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `_EntityToEntityTag` (
`A` int NOT NULL,
`B` int NOT NULL,
UNIQUE KEY `_EntityToEntityTag_AB_unique` (`A`,`B`),
KEY `_EntityToEntityTag_B_index` (`B`),
CONSTRAINT `_EntityToEntityTag_A_fkey` FOREIGN KEY (`A`) REFERENCES `Entity` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `_EntityToEntityTag_B_fkey` FOREIGN KEY (`B`) REFERENCES `EntityTag` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
outputs import { mysqlTable, mysqlSchema, AnyMySqlColumn, primaryKey, int, varchar, index, foreignKey, unique } from "drizzle-orm/mysql-core"
import { sql } from "drizzle-orm"
export const entity = mysqlTable("Entity", {
id: int("id").autoincrement().notNull(),
name: varchar("name", { length: 191 }).notNull(),
},
(table) => {
return {
entityId: primaryKey({ columns: [table.id], name: "Entity_id"}),
}
});
export const entityTag = mysqlTable("EntityTag", {
id: int("id").autoincrement().notNull(),
name: varchar("name", { length: 191 }).notNull(),
},
(table) => {
return {
entityTagId: primaryKey({ columns: [table.id], name: "EntityTag_id"}),
}
});
export const entityToEntityTag = mysqlTable("_EntityToEntityTag", {
a: int("A").notNull().references(() => entity.id, { onDelete: "cascade", onUpdate: "cascade" } ),
b: int("B").notNull().references(() => entityTag.id, { onDelete: "cascade", onUpdate: "cascade" } ),
},
(table) => {
return {
bIdx: index().on(table.b),
entityToEntityTagAbUnique: unique("_EntityToEntityTag_AB_unique").on(table.a, table.b),
}
}); No index names |
Also not working for us in |
Seeing this as well, |
What version of
drizzle-orm
are you using?0.31.2
What version of
drizzle-kit
are you using?0.22.6
Describe the Bug
I ran introspect command but It doesn't get index names
Expected behavior
I expected to get the index name
_TableToOtherTable_B_index
Environment & setup
mysql v8.0.32
The text was updated successfully, but these errors were encountered: