© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
1 reply
Samir

Issue with push command

Hello. I pushed migrations to database using
drizzle-kit push:mysql
drizzle-kit push:mysql
and It worked fine. Running it again gave me error. (check image)

My Table:
export const linksVisitor = mysqlTable(
  "links_visitor",
  {
    linkId: varchar("link_id", { length: 24 }).references(() => links.id, {
      onDelete: "cascade",
    }),
    viewedAt: timestamp("viewed_at").defaultNow(),
    linkCreator: varchar("link_creator", { length: 255 })
      .references(() => user.id, { onDelete: "cascade" })
      .notNull(),
    ip: varchar("ip", { length: 20 }).notNull(),
  },
  (self) => ({
    pk: primaryKey({
      columns: [self.linkId, self.ip],
    }),
  })
);
export const linksVisitor = mysqlTable(
  "links_visitor",
  {
    linkId: varchar("link_id", { length: 24 }).references(() => links.id, {
      onDelete: "cascade",
    }),
    viewedAt: timestamp("viewed_at").defaultNow(),
    linkCreator: varchar("link_creator", { length: 255 })
      .references(() => user.id, { onDelete: "cascade" })
      .notNull(),
    ip: varchar("ip", { length: 20 }).notNull(),
  },
  (self) => ({
    pk: primaryKey({
      columns: [self.linkId, self.ip],
    }),
  })
);
Screenshot_2024-04-02_at_7.50.46_PM.png
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Issue with migration [push, migrate] command in postgressql
Drizzle TeamDTDrizzle Team / help
11mo ago
postgres push issue
Drizzle TeamDTDrizzle Team / help
3y ago
unable to use the `push` command
Drizzle TeamDTDrizzle Team / help
17mo ago
drizzle-kit push command is really slow
Drizzle TeamDTDrizzle Team / help
4mo ago