重构:将 "lobster" 重命名为 "claw" 并添加国际化支持 (i18n)
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
} from "drizzle-orm/mysql-core";
|
||||
import { sql } from "drizzle-orm";
|
||||
|
||||
export const lobsters = mysqlTable("lobsters", {
|
||||
export const claws = mysqlTable("claws", {
|
||||
id: varchar("id", { length: 21 }).primaryKey(),
|
||||
apiKey: varchar("api_key", { length: 64 }).notNull().unique(),
|
||||
name: varchar("name", { length: 100 }).notNull(),
|
||||
@@ -33,12 +33,12 @@ export const heartbeats = mysqlTable(
|
||||
"heartbeats",
|
||||
{
|
||||
id: bigint("id", { mode: "number" }).primaryKey().autoincrement(),
|
||||
lobsterId: varchar("lobster_id", { length: 21 }).notNull(),
|
||||
clawId: varchar("claw_id", { length: 21 }).notNull(),
|
||||
ip: varchar("ip", { length: 45 }),
|
||||
timestamp: datetime("timestamp").default(sql`NOW()`),
|
||||
},
|
||||
(table) => [
|
||||
index("heartbeats_lobster_id_idx").on(table.lobsterId),
|
||||
index("heartbeats_claw_id_idx").on(table.clawId),
|
||||
index("heartbeats_timestamp_idx").on(table.timestamp),
|
||||
]
|
||||
);
|
||||
@@ -47,7 +47,7 @@ export const tasks = mysqlTable(
|
||||
"tasks",
|
||||
{
|
||||
id: bigint("id", { mode: "number" }).primaryKey().autoincrement(),
|
||||
lobsterId: varchar("lobster_id", { length: 21 }).notNull(),
|
||||
clawId: varchar("claw_id", { length: 21 }).notNull(),
|
||||
summary: varchar("summary", { length: 500 }),
|
||||
durationMs: int("duration_ms"),
|
||||
model: varchar("model", { length: 50 }),
|
||||
@@ -55,7 +55,7 @@ export const tasks = mysqlTable(
|
||||
timestamp: datetime("timestamp").default(sql`NOW()`),
|
||||
},
|
||||
(table) => [
|
||||
index("tasks_lobster_id_idx").on(table.lobsterId),
|
||||
index("tasks_claw_id_idx").on(table.clawId),
|
||||
index("tasks_timestamp_idx").on(table.timestamp),
|
||||
]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user