✪ Flamakæ
✪ Flamakæ
CCConvex Community
Created by ✪ Flamakæ on 2/15/2025 in #support-community
Schema and functions advice
import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";

// The schema is entirely optional.
// You can delete this file (schema.ts) and the
// app will continue to work.
// The schema provides more precise TypeScript types.
export default defineSchema({
deploymentRecords: defineTable({
company: v.id("companies"),
confluencePageId: v.string(),
confluencePageUrl: v.string(),
date: v.string(),
engineer: v.id("engineers"),
environment: v.id("environments"),
jiraTickets: v.array(v.id("jiraTickets")),
notes: v.optional(v.string()),
product: v.id("products"),
title: v.string(),
version: v.string(),
}),
companies: defineTable({
title: v.string(),
}),
environments: defineTable({
slug: v.string(),
}),
products: defineTable({
title: v.string(),
}),
engineers: defineTable({
name: v.string(),
}),
jiraTickets: defineTable({
ticketId: v.string(),
status: v.union(
v.literal("BLUE"),
v.literal("YELLOW"),
v.literal("GREEN"),
v.literal("RED"),
v.literal("ORANGE"),
),
freshdeskTickets: v.array(v.string()),
}),
});
import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";

// The schema is entirely optional.
// You can delete this file (schema.ts) and the
// app will continue to work.
// The schema provides more precise TypeScript types.
export default defineSchema({
deploymentRecords: defineTable({
company: v.id("companies"),
confluencePageId: v.string(),
confluencePageUrl: v.string(),
date: v.string(),
engineer: v.id("engineers"),
environment: v.id("environments"),
jiraTickets: v.array(v.id("jiraTickets")),
notes: v.optional(v.string()),
product: v.id("products"),
title: v.string(),
version: v.string(),
}),
companies: defineTable({
title: v.string(),
}),
environments: defineTable({
slug: v.string(),
}),
products: defineTable({
title: v.string(),
}),
engineers: defineTable({
name: v.string(),
}),
jiraTickets: defineTable({
ticketId: v.string(),
status: v.union(
v.literal("BLUE"),
v.literal("YELLOW"),
v.literal("GREEN"),
v.literal("RED"),
v.literal("ORANGE"),
),
freshdeskTickets: v.array(v.string()),
}),
});
Want to get recommendations about this schema and how to work with them. Thanks!
5 replies