feat(11-01): add five Drizzle table definitions for skill groups

- Add primaryKey import from drizzle-orm/sqlite-core
- Add skillGroups table with id, name, description, isBuiltin, timestamps
- Add skillGroupMembers junction table with composite PK (groupId, skillId)
- Add skillGroupInheritance table with composite PK (childGroupId, parentGroupId)
- Add agentSkillGroups table with composite PK (agentId, groupId)
- Add agentSkills table with composite PK (agentId, skillId)
This commit is contained in:
Mikkel Georgsen 2026-04-01 03:20:48 +02:00
parent 328e44b887
commit 2a5bfc16e8

View file

@ -1,4 +1,4 @@
import { sqliteTable, text, integer, real } from "drizzle-orm/sqlite-core";
import { sqliteTable, text, integer, real, primaryKey } from "drizzle-orm/sqlite-core";
export const skills = sqliteTable("skills", {
id: text("id").primaryKey(),
@ -36,3 +36,43 @@ export const communityRatings = sqliteTable("community_ratings", {
ratingCount: integer("rating_count"),
source: text("source"),
});
export const skillGroups = sqliteTable("skill_groups", {
id: text("id").primaryKey(),
name: text("name").notNull(),
description: text("description"),
isBuiltin: integer("is_builtin").notNull().default(0),
createdAt: integer("created_at").notNull(),
updatedAt: integer("updated_at").notNull(),
});
export const skillGroupMembers = sqliteTable("skill_group_members", {
groupId: text("group_id").notNull(),
skillId: text("skill_id").notNull(),
addedAt: integer("added_at").notNull(),
}, (t) => ({
pk: primaryKey({ columns: [t.groupId, t.skillId] }),
}));
export const skillGroupInheritance = sqliteTable("skill_group_inheritance", {
childGroupId: text("child_group_id").notNull(),
parentGroupId: text("parent_group_id").notNull(),
}, (t) => ({
pk: primaryKey({ columns: [t.childGroupId, t.parentGroupId] }),
}));
export const agentSkillGroups = sqliteTable("agent_skill_groups", {
agentId: text("agent_id").notNull(),
groupId: text("group_id").notNull(),
assignedAt: integer("assigned_at").notNull(),
}, (t) => ({
pk: primaryKey({ columns: [t.agentId, t.groupId] }),
}));
export const agentSkills = sqliteTable("agent_skills", {
agentId: text("agent_id").notNull(),
skillId: text("skill_id").notNull(),
installedAt: integer("installed_at").notNull(),
}, (t) => ({
pk: primaryKey({ columns: [t.agentId, t.skillId] }),
}));