Skip to content

Commit 6481f8e

Browse files
13 - Your First Database Schema
1 parent 11c47bd commit 6481f8e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/db/schemas.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const { serial } = require("drizzle-orm/mysql-core");
2+
const { text, timestamp, pgTable } = require("drizzle-orm/pg-core");
3+
4+
const LeadTable = pgTable('leads', {
5+
id: serial('id').primaryKey().notNull(),
6+
email: text('email').notNull(),
7+
description: text('description').default('This is my comment'),
8+
createdAt: timestamp('created_at').defaultNow(),
9+
});
10+
11+
module.exports.LeadTable = LeadTable

0 commit comments

Comments
 (0)