import{sqliteTable as n,text as e,integer as s,index as i,uniqueIndex as o}from"drizzle-orm/sqlite-core";const d=n("entities",{id:e("id").primaryKey(),organizationId:e("organization_id").notNull(),projectId:e("project_id").notNull(),key:e("key").notNull(),type:e("type").notNull(),title:e("title").notNull(),summary:e("summary"),tags:e("tags"),metadata:e("metadata"),git:e("git"),contact:e("contact"),links:e("links"),createdAt:e("created_at").notNull(),updatedAt:e("updated_at").notNull(),source:e("source").default("file"),sourceFile:e("source_file"),fileHash:e("file_hash"),version:e("version").default("not_specified_version").notNull(),revision:e("revision").notNull(),hash:e("hash"),isCurrent:s("is_current",{mode:"boolean"}).default(!0),isDefaultVersion:s("is_default_version",{mode:"boolean"}).default(!1),isDeleted:s("is_deleted",{mode:"boolean"}).default(!1),scorecardsStatus:e("scorecards_status"),lastSeenRunId:e("last_seen_run_id")},t=>[i("idx_entities_type").on(t.type),i("idx_entities_hash").on(t.hash),i("idx_entities_key_source_created_at").on(t.key,t.createdAt),i("idx_entities_key_source_is_current").on(t.key,t.isCurrent,t.isDeleted),i("idx_entities_key_source_is_default").on(t.key,t.isDefaultVersion),i("idx_entities_source_last_seen_run_id").on(t.source,t.lastSeenRunId),o("idx_entities_key_source").on(t.key,t.source,t.revision,t.version)]);export{d as entitiesTable};
