summaryrefslogtreecommitdiffhomepage
path: root/cloud/core/src/schema
diff options
context:
space:
mode:
Diffstat (limited to 'cloud/core/src/schema')
-rw-r--r--cloud/core/src/schema/key.sql.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/cloud/core/src/schema/key.sql.ts b/cloud/core/src/schema/key.sql.ts
index 07982779b..98b99c788 100644
--- a/cloud/core/src/schema/key.sql.ts
+++ b/cloud/core/src/schema/key.sql.ts
@@ -10,8 +10,13 @@ export const KeyTable = mysqlTable(
...timestamps,
actor: json("actor").$type<Actor.Info>(),
name: varchar("name", { length: 255 }).notNull(),
+ oldName: varchar("old_name", { length: 255 }),
key: varchar("key", { length: 255 }).notNull(),
timeUsed: utc("time_used"),
},
- (table) => [...workspaceIndexes(table), uniqueIndex("global_key").on(table.key)],
+ (table) => [
+ ...workspaceIndexes(table),
+ uniqueIndex("global_key").on(table.key),
+ uniqueIndex("name").on(table.workspaceID, table.name),
+ ],
)