Spaces:
Sleeping
Sleeping
Download lib/db/src/schema/articles.ts from Tahasaif3/DataExtract: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/spaces/Tahasaif3/DataExtract/resolve/main/lib/db/src/schema/articles.ts
- Command line
-
hf download hf://spaces/Tahasaif3/DataExtract/lib/db/src/schema/articles.ts
-
curl -L -o articles.ts https://huggingface.co/spaces/Tahasaif3/DataExtract/resolve/main/lib/db/src/schema/articles.ts
1.07 kB
| import { integer, pgTable, text, timestamp } from 'drizzle-orm/pg-core'; | |
| import { createInsertSchema } from 'drizzle-zod'; | |
| export const articlesTable = pgTable('articles', { | |
| id: text('id').primaryKey(), | |
| slug: text('slug').notNull().unique(), | |
| title: text('title').notNull(), | |
| excerpt: text('excerpt').notNull().default(''), | |
| content: text('content').notNull().default(''), | |
| category: text('category').notNull(), | |
| author: text('author').notNull(), | |
| tags: text('tags').notNull().default(''), | |
| image: text('image').notNull().default(''), | |
| imageAlt: text('image_alt').notNull().default(''), | |
| status: text('status', { enum: ['Draft', 'Published'] }).notNull().default('Draft'), | |
| version: integer('version').notNull().default(1), | |
| updatedAt: timestamp('updated_at', { withTimezone: true }).notNull().defaultNow(), | |
| publishedAt: timestamp('published_at', { withTimezone: true }), | |
| }); | |
| export const insertArticleSchema = createInsertSchema(articlesTable).omit({ updatedAt: true, publishedAt: true }); | |
| export type Article = typeof articlesTable.$inferSelect; | |