Drizzle migration error with Example table.

Any reason why I am getting this error when I do pnpm db:push for the 2nd time? No changes made.
No description
3 Replies
dex
dexOP14mo ago
For more context: I created a t3-app, put in the env variables needed, ran db:push, changed the users schema then tried to run db:push again. But I get this error because of the example table which I did not change.
export const example = mysqlTable(
"example",
{
id: bigint("id", { mode: "number" }).primaryKey().autoincrement(),
name: varchar("name", { length: 256 }),
createdAt: timestamp("created_at")
.default(sql`CURRENT_TIMESTAMP`)
.notNull(),
updatedAt: timestamp("updatedAt").onUpdateNow(),
},
(example) => ({
nameIndex: uniqueIndex("name_idx").on(example.name),
}),
);
export const example = mysqlTable(
"example",
{
id: bigint("id", { mode: "number" }).primaryKey().autoincrement(),
name: varchar("name", { length: 256 }),
createdAt: timestamp("created_at")
.default(sql`CURRENT_TIMESTAMP`)
.notNull(),
updatedAt: timestamp("updatedAt").onUpdateNow(),
},
(example) => ({
nameIndex: uniqueIndex("name_idx").on(example.name),
}),
);
dragonflyof99
dragonflyof9913mo ago
did you ever figure this out?
dex
dexOP13mo ago
nope @dragonflyof99 i just did drizzle-kit generate and manually copies the migrations to TablePlus
Want results from more Discord servers?
Add your server