mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
28 lines
894 B
TypeScript
28 lines
894 B
TypeScript
import { bigint, bigserial, date, integer, pgTable, text } from "drizzle-orm/pg-core";
|
|
import { element } from "./element";
|
|
import { aspectType } from "./aspect_type";
|
|
import { InferInsertModel, InferSelectModel } from "drizzle-orm";
|
|
|
|
export const aspectCondition = pgTable("aspect_condition", {
|
|
id: bigserial("id", { mode: "bigint" }).primaryKey(),
|
|
|
|
elementId: bigint("element_id", { mode: "number" })
|
|
.notNull()
|
|
.references(() => element.id),
|
|
|
|
aspectType: aspectType("aspect_type").notNull(),
|
|
aspectInstance: integer("aspect_instance").notNull(),
|
|
|
|
value: text("value"),
|
|
quantity: integer("quantity"),
|
|
installDate: date("install_date"),
|
|
renewalYear: integer("renewal_year"),
|
|
comments: text("comments"),
|
|
});
|
|
|
|
export type AspectConditionRow =
|
|
InferSelectModel<typeof aspectCondition>;
|
|
|
|
export type NewAspectConditionRow =
|
|
InferInsertModel<typeof aspectCondition>;
|
|
|