mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Working on implementation of alert policies.
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
import { pgTable, text, uuid } from "drizzle-orm/pg-core";
|
||||
import { relations } from "drizzle-orm";
|
||||
import { project } from "./06_project";
|
||||
import { createSelectSchema } from "drizzle-zod";
|
||||
import { z } from "zod";
|
||||
import {pgTable, text, uuid} from "drizzle-orm/pg-core";
|
||||
import {relations} from "drizzle-orm";
|
||||
import {Project, project} from "./06_project";
|
||||
import {createSelectSchema} from "drizzle-zod";
|
||||
import {z} from "zod";
|
||||
import {invitation, OrganizationInvitation} from "@/db/schema/05_invitation";
|
||||
import {member, OrganizationMember} from "@/db/schema/04_member";
|
||||
import {User} from "@/db/schema/02_user";
|
||||
import {timestamps} from "@/db/schema/00_common";
|
||||
import {organizationNotificationChannel} from "@/db/schema/09_notification-channel";
|
||||
import {NotificationChannel, organizationNotificationChannel} from "@/db/schema/09_notification-channel";
|
||||
import {Agent} from "@/db/schema/08_agent";
|
||||
import {AlertPolicy} from "@/db/schema/10_alert-policy";
|
||||
import {Backup, Database, Restoration, RetentionPolicy} from "@/db/schema/07_database";
|
||||
|
||||
export const organization = pgTable("organization", {
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
@@ -19,7 +22,7 @@ export const organization = pgTable("organization", {
|
||||
});
|
||||
|
||||
|
||||
export const organizationRelations = relations(organization, ({ many }) => ({
|
||||
export const organizationRelations = relations(organization, ({many}) => ({
|
||||
members: many(member),
|
||||
invitations: many(invitation),
|
||||
projects: many(project),
|
||||
@@ -27,7 +30,6 @@ export const organizationRelations = relations(organization, ({ many }) => ({
|
||||
}));
|
||||
|
||||
|
||||
|
||||
export const organizationSchema = createSelectSchema(organization);
|
||||
export type Organization = z.infer<typeof organizationSchema>;
|
||||
|
||||
@@ -42,4 +44,12 @@ export type MemberWithUser = OrganizationMember & {
|
||||
export type OrganizationWithMembersAndUsers = Organization & {
|
||||
members: MemberWithUser[];
|
||||
invitations: OrganizationInvitation[];
|
||||
};
|
||||
};
|
||||
|
||||
export type OrganizationWith = Organization & {
|
||||
user?: User | null;
|
||||
members?: MemberWithUser[] | null;
|
||||
invitations?: OrganizationInvitation[] | null;
|
||||
notificationChannels?: NotificationChannel[] | null;
|
||||
projects?: Project[] | null;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user