/
Alex_Ural
/
opencode
Обзор
Документация
Войти
/
Alex_Ural
/
opencode
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
packages/core/src/permission/sql.ts
20 строк
724 B
Dax
feat(core): add location-based permission service (#30287)
02 июн 2026, 04:32
Не верифицирован
02 июн 2026, 04:32
9b815bc
Код
Авторство
О чём код?
import { sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core" import { Timestamps } from "../database/schema.sql" import { ProjectV2 } from "../project" import { ProjectTable } from "../project/sql" import type { PermissionSaved } from "./saved" export const PermissionTable = sqliteTable( "permission", { id: text().$type<PermissionSaved.ID>().primaryKey(), project_id: text() .$type<ProjectV2.ID>() .notNull() .references(() => ProjectTable.id, { onDelete: "cascade" }), action: text().notNull(), resource: text().notNull(), ...Timestamps, }, (table) => [uniqueIndex("permission_project_action_resource_idx").on(table.project_id, table.action, table.resource)], )