fix: change casing for apiKey schema
This commit is contained in:
@@ -2,7 +2,7 @@ import { desc, eq } from "drizzle-orm";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
import type { dbClient } from "@kan/db/client";
|
||||
import { apiKey, users } from "@kan/db/schema";
|
||||
import { apikey, users } from "@kan/db/schema";
|
||||
|
||||
export const getById = async (db: dbClient, userId: string) => {
|
||||
return await db.query.users.findFirst({
|
||||
@@ -20,7 +20,7 @@ export const getById = async (db: dbClient, userId: string) => {
|
||||
prefix: true,
|
||||
key: true,
|
||||
},
|
||||
orderBy: desc(apiKey.createdAt),
|
||||
orderBy: desc(apikey.createdAt),
|
||||
limit: 1,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -51,7 +51,7 @@ export const verification = pgTable("verification", {
|
||||
updatedAt: timestamp("updatedAt"),
|
||||
}).enableRLS();
|
||||
|
||||
export const apiKey = pgTable("apiKey", {
|
||||
export const apikey = pgTable("apiKey", {
|
||||
id: bigserial("id", { mode: "number" }).primaryKey(),
|
||||
name: text("name"),
|
||||
start: text("start"),
|
||||
@@ -77,9 +77,9 @@ export const apiKey = pgTable("apiKey", {
|
||||
metadata: text("metadata"),
|
||||
}).enableRLS();
|
||||
|
||||
export const apiKeyRelations = relations(apiKey, ({ one }) => ({
|
||||
export const apiKeyRelations = relations(apikey, ({ one }) => ({
|
||||
user: one(users, {
|
||||
fields: [apiKey.userId],
|
||||
fields: [apikey.userId],
|
||||
references: [users.id],
|
||||
}),
|
||||
}));
|
||||
|
||||
@@ -8,5 +8,3 @@ export * from "./labels";
|
||||
export * from "./lists";
|
||||
export * from "./users";
|
||||
export * from "./workspaces";
|
||||
|
||||
export { apiKey as apikey } from "./auth";
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
varchar,
|
||||
} from "drizzle-orm/pg-core";
|
||||
|
||||
import { apiKey } from "./auth";
|
||||
import { apikey } from "./auth";
|
||||
import { boards } from "./boards";
|
||||
import { cards } from "./cards";
|
||||
import { imports } from "./imports";
|
||||
@@ -34,7 +34,7 @@ export const usersRelations = relations(users, ({ many }) => ({
|
||||
imports: many(imports),
|
||||
lists: many(lists),
|
||||
workspaces: many(workspaces),
|
||||
apiKeys: many(apiKey),
|
||||
apiKeys: many(apikey),
|
||||
}));
|
||||
|
||||
export const usersToWorkspacesRelations = relations(
|
||||
|
||||
Reference in New Issue
Block a user