Skip to content

Commit

Permalink
Merge pull request #34 from prtcl/chore/remove-optional
Browse files Browse the repository at this point in the history
remove optional from schema defs
  • Loading branch information
prtcl authored Nov 12, 2024
2 parents 37a666e + 7ee012d commit b7fc1f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions convex/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const populateFeatureFlags = internalMutation({
for (const flag of initialFlags) {
if (!existingKeys.has(flag)) {
const insertedId = await ctx.db.insert('features', {
description: null,
key: flag,
value: false,
});
Expand Down
14 changes: 7 additions & 7 deletions convex/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ const services = v.union(

const projects = defineTable({
category: categories,
contentId: v.optional(v.union(v.id('content'), v.null())),
coverImageId: v.optional(v.union(v.id('images'), v.null())),
contentId: v.union(v.id('content'), v.null()),
coverImageId: v.union(v.id('images'), v.null()),
deletedAt: v.union(v.number(), v.null()),
embedId: v.optional(v.union(v.id('embeds'), v.null())),
embedId: v.union(v.id('embeds'), v.null()),
order: v.number(),
previewImageId: v.optional(v.union(v.id('images'), v.null())),
previewImageId: v.union(v.id('images'), v.null()),
publishedAt: v.union(v.number(), v.null()),
title: v.string(),
updatedAt: v.optional(v.union(v.number(), v.null())),
updatedAt: v.union(v.number(), v.null()),
url: v.string(),
}).index('deletedByOrder', ['deletedAt', 'order']);

const embeds = defineTable({
deletedAt: v.union(v.number(), v.null()),
service: services,
src: v.string(),
updatedAt: v.optional(v.union(v.number(), v.null())),
updatedAt: v.union(v.number(), v.null()),
});

const content = defineTable({
Expand All @@ -55,7 +55,7 @@ const images = defineTable({
});

export const features = defineTable({
description: v.optional(v.union(v.string(), v.null())),
description: v.union(v.string(), v.null()),
key: v.string(),
value: v.boolean(),
});
Expand Down

0 comments on commit b7fc1f5

Please sign in to comment.