Skip to content

Instantly share code, notes, and snippets.

@stephenlacy
stephenlacy / schema.ts
Created July 1, 2024 23:13
Using TypeIDs with Drizzle
export const apiKeys = mysqlTable(
"api_keys",
{
id: typeId("api_keys").primaryKey(),
organizationId: typeId("organizations", "organization_id").notNull(),
name: varchar("name", { length: 256 }),
prefix: varchar("prefix", { length: 256 }),
}
);

Keybase proof

I hereby claim:

  • I am stevelacy on github.
  • I am stevelacy (https://keybase.io/stevelacy) on keybase.
  • I have a public key ASCRiLTDs3sE_fZgD3q0CA_FvfdYLSiG8HoOSj1lMKa1Fgo

To claim this, I am signing this object: