This commit is contained in:
@@ -97,30 +97,6 @@ export const clients = sqliteTable(
|
||||
}),
|
||||
);
|
||||
|
||||
export const categories = sqliteTable(
|
||||
"categories",
|
||||
{
|
||||
id: text("id")
|
||||
.primaryKey()
|
||||
.$defaultFn(() => nanoid()),
|
||||
organizationId: text("organization_id").notNull(),
|
||||
name: text("name").notNull(),
|
||||
color: text("color"),
|
||||
createdAt: integer("created_at", { mode: "timestamp" }).$defaultFn(
|
||||
() => new Date(),
|
||||
),
|
||||
},
|
||||
(table: any) => ({
|
||||
orgFk: foreignKey({
|
||||
columns: [table.organizationId],
|
||||
foreignColumns: [organizations.id],
|
||||
}),
|
||||
organizationIdIdx: index("categories_organization_id_idx").on(
|
||||
table.organizationId,
|
||||
),
|
||||
}),
|
||||
);
|
||||
|
||||
export const timeEntries = sqliteTable(
|
||||
"time_entries",
|
||||
{
|
||||
@@ -130,7 +106,6 @@ export const timeEntries = sqliteTable(
|
||||
userId: text("user_id").notNull(),
|
||||
organizationId: text("organization_id").notNull(),
|
||||
clientId: text("client_id").notNull(),
|
||||
categoryId: text("category_id").notNull(),
|
||||
startTime: integer("start_time", { mode: "timestamp" }).notNull(),
|
||||
endTime: integer("end_time", { mode: "timestamp" }),
|
||||
description: text("description"),
|
||||
@@ -153,10 +128,6 @@ export const timeEntries = sqliteTable(
|
||||
columns: [table.clientId],
|
||||
foreignColumns: [clients.id],
|
||||
}),
|
||||
categoryFk: foreignKey({
|
||||
columns: [table.categoryId],
|
||||
foreignColumns: [categories.id],
|
||||
}),
|
||||
userIdIdx: index("time_entries_user_id_idx").on(table.userId),
|
||||
organizationIdIdx: index("time_entries_organization_id_idx").on(
|
||||
table.organizationId,
|
||||
|
||||
Reference in New Issue
Block a user