summaryrefslogtreecommitdiff
path: root/db/schema/user-custom-data/userCustomData.ts
blob: bf5296797f3e973618e551dd8b4fd96803a2d235 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/** 
 * user custom data
 * 
 * */
import { integer, json, pgTable, timestamp, uuid, varchar } from "drizzle-orm/pg-core";
import { users } from "../users";

export const userCustomData = pgTable("user_custom_data", {
  id: uuid("id").primaryKey().defaultRandom(),
  userId: integer("user_id").references(() => users.id),
  tableKey: varchar("table_key", { length: 255 }).notNull(),
  customSettingName: varchar("custom_setting_name", { length: 255 }).notNull(),
  customSetting: json("custom_setting"),
  createdDate: timestamp("created_date", { withTimezone: true }).defaultNow().notNull(),
  updatedDate: timestamp("updated_date", { withTimezone: true }).defaultNow().notNull(),
});