✪ Flamakæ
✪ Flamakæ7d ago

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!
3 Replies
Convex Bot
Convex Bot7d ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
erquhart
erquhart5d ago
Sure, is there something specific you're trying to do? You can also paste your schema into a message in #ask-ai and ask kapa all sorts of questions, quick answers that way if you're just figuring things out.
✪ Flamakæ
✪ FlamakæOP5d ago
I am just trying to create a simple Deployment Tracker app. In site I am planning to show data table with deployments. And ability to add, edit and remove records. I just wanted to get advice about my schema. And if there is recommendations on how can I improve it. So in future I can work with it easily

Did you find this page helpful?