Skip to content

Commit

Permalink
feat: hostels schema
Browse files Browse the repository at this point in the history
  • Loading branch information
heydoyouknowme0 committed Aug 16, 2024
1 parent 46198f4 commit 9353e1e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions server/db/schema/hostels.schema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { pgTable, serial, text, timestamp, varchar } from 'drizzle-orm/pg-core';

export const hostels = pgTable('hostels', {
id: serial('id').primaryKey(),
address: text('address').notNull(),
name: varchar('name', { length: 256 }).notNull(),
email: varchar('email', { length: 256 }).notNull(),
telephone: varchar('telephone', { length: 13 }).notNull(),
alternateTelephone: varchar('alternate_telephone', { length: 13 }),
type: varchar('type', {
enum: ['boys', 'girls'],
}).notNull(),
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at')
.$onUpdate(() => new Date())
.notNull(),
});

0 comments on commit 9353e1e

Please sign in to comment.