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.4 kB ยท 47 lines
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748import { sql } from "drizzle-orm";import { integer, sqliteTable, text, uniqueIndex,} from "drizzle-orm/sqlite-core";
import { externalService } from "./external_service";
export const externalServiceComponent = sqliteTable( "external_service_component", { id: integer("id").primaryKey(), externalServiceId: integer("external_service_id") .notNull() .references(() => externalService.id), upstreamComponentId: text("upstream_component_id").notNull(), slug: text("slug").notNull(), aliases: text("aliases", { mode: "json" }) .$type<string[]>() .default(sql`(json_array())`) .notNull(), name: text("name").notNull(), description: text("description"), groupName: text("group_name"), position: integer("position").notNull().default(0), indicator: text("indicator").notNull(), status: text("status").notNull(), firstSeenAt: integer("first_seen_at", { mode: "timestamp" }) .notNull() .default(sql`(strftime('%s', 'now'))`), updatedAt: integer("updated_at", { mode: "timestamp" }) .notNull() .default(sql`(strftime('%s', 'now'))`), }, (t) => [ uniqueIndex("external_service_component_unique_idx").on( t.externalServiceId, t.upstreamComponentId, ), uniqueIndex("external_service_component_slug_unique_idx").on( t.externalServiceId, t.slug, ), ],);