Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
1.3 kB ยท 36 lines
TypeScript
12345678910111213141516171819202122232425262728293031323334353637import { sql } from "drizzle-orm";import { index, integer, sqliteTable, text } from "drizzle-orm/sqlite-core";import { createInsertSchema, createSelectSchema } from "drizzle-zod";import type { z } from "zod";
import { workspace } from "./workspaces";
export const integration = sqliteTable( "integration", { id: integer("id").primaryKey(), name: text("name", { length: 256 }).notNull(), // Should be vercel or other
workspaceId: integer("workspace_id").references(() => workspace.id),
// Not used yet but we might need to get store something for the integration webhook url and or secret credential: text("credential", { mode: "json" }),
externalId: text("external_id").notNull(), // the id of the integration in the external service
createdAt: integer("created_at", { mode: "timestamp" }).default( sql`(strftime('%s', 'now'))`, ), updatedAt: integer("updated_at", { mode: "timestamp" }).default( sql`(strftime('%s', 'now'))`, ),
data: text("data", { mode: "json" }).notNull(), }, (t) => [index("integration_workspace_id_idx").on(t.workspaceId)],);
export const insertIntegrationSchema = createInsertSchema(integration);export const selectIntegrationSchema = createSelectSchema(integration);
export type Integration = z.infer<typeof selectIntegrationSchema>;