work-hub-server/packages/schema/src/drizzle/projects.ts
Nicolas HOARAU f11c306ac6
All checks were successful
ci / ci (22) (push) Successful in 11m57s
feat: add type checking and linting improvements across the project
- Added "check-types" script to package.json for type checking in both api and web apps.
- Updated ESLint configuration to use a shared tooling package for consistent linting rules.
- Refactored TypeScript configurations to extend from shared tooling configurations.
- Improved code formatting and consistency in various files, including Vue components and TypeScript files.
- Introduced CI workflow for automated linting, formatting checks, and type checking on push and pull request events.
- Cleaned up unnecessary dependencies and updated existing ones for better performance and maintainability.
2026-06-04 16:33:06 +04:00

19 lines
743 B
TypeScript

import { pgTable, uuid, text, timestamp, check } from "drizzle-orm/pg-core";
import { sql } from "drizzle-orm";
import { PROJECT_STATUSES } from "./enums";
const projectStatusValues = PROJECT_STATUSES.map((s) => `'${s}'`).join(", ");
export const projects = pgTable(
"projects",
{
id: uuid("id").primaryKey().defaultRandom(),
name: text("name").notNull(),
description: text("description"),
status: text("status").notNull().default("active"),
createdAt: timestamp("created_at", { mode: "string" }).notNull().defaultNow(),
updatedAt: timestamp("updated_at", { mode: "string" }).notNull().defaultNow(),
},
(table) => [check("project_status_check", sql`${table.status} IN (${sql.raw(projectStatusValues)})`)],
);