Created
May 17, 2024 21:27
-
-
Save PaulieScanlon/2cee08be2f2835d3da9f5db47ed75eda to your computer and use it in GitHub Desktop.
Example of Drizzle ORM create table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { pgTable, serial, varchar } from 'drizzle-orm/pg-core'; | |
export const users = pgTable('users', { | |
user_id: serial('user_id').primaryKey(), | |
first_name: varchar('first_name', { length: 100 }), | |
last_name: varchar('last_name', { length: 100 }), | |
email: varchar('email', { length: 80 }).unique(), | |
role: varchar('role', { length: 20 }), | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment