Open Vic-M opened 3 months ago
This, but for postgres
import { relations } from 'drizzle-orm'; import { integer, pgTable, serial, text, timestamp, varchar, } from 'drizzle-orm/pg-core';
export const users = pgTable('users', { id: serial('id').primaryKey(), username: text('username'), email: text('email'), password: varchar('password', { length: 256 }), createdAt: timestamp('createdAt').defaultNow().notNull(), updatedAt: timestamp('updatedAt').defaultNow().notNull(), });
exacly same problem here!
When running
drizzle-kit introspect:mysql
, no primary keys are generated for table properties in the resulting schema.ts.Steps to reproduce
Generate database:
Introspect the database schema:
Output
schema.ts
Expected
Notes
drizzle-orm version: 0.30.1 drizzle-kit version: 0.20.14 mysql2 version: 3.9.2 database: MariaDB 10.6.15