banatie-service/packages/database/src/schema/organizations.ts

17 lines
575 B
TypeScript

import { pgTable, uuid, text, timestamp } from 'drizzle-orm/pg-core';
export const organizations = pgTable('organizations', {
id: uuid('id').primaryKey().defaultRandom(),
// Organization details
name: text('name').notNull(),
email: text('email').notNull().unique(),
// Timestamps
createdAt: timestamp('created_at').notNull().defaultNow(),
updatedAt: timestamp('updated_at').notNull().defaultNow().$onUpdate(() => new Date()),
});
export type Organization = typeof organizations.$inferSelect;
export type NewOrganization = typeof organizations.$inferInsert;