Initial commit
This commit is contained in:
14
packages/db/schema/post.ts
Normal file
14
packages/db/schema/post.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { sql } from "drizzle-orm";
|
||||
import { serial, timestamp, varchar } from "drizzle-orm/mysql-core";
|
||||
|
||||
import { mySqlTable } from "./_table";
|
||||
|
||||
export const post = mySqlTable("post", {
|
||||
id: serial("id").primaryKey(),
|
||||
title: varchar("name", { length: 256 }).notNull(),
|
||||
content: varchar("content", { length: 256 }).notNull(),
|
||||
createdAt: timestamp("created_at")
|
||||
.default(sql`CURRENT_TIMESTAMP`)
|
||||
.notNull(),
|
||||
updatedAt: timestamp("updatedAt").onUpdateNow(),
|
||||
});
|
||||
Reference in New Issue
Block a user