Skip to content

Function: addRbacExpiryColumns() ​

ts
function addRbacExpiryColumns(db, options?): Promise<void>;

Defined in: packages/kysely/src/schema.ts:189

Upgrades existing tables for expiry (1.2): adds the nullable expires_at column to model_has_roles and model_has_permissions. Existing rows get NULL (permanent). Tables that already have it are skipped. Then create the adapter with kyselyAdapter(db, { expiry: true }).

Parameters ​

ParameterType
dbKysely<any>
options?RbacMigrationOptions

Returns ​

Promise<void>

Released under the MIT License. Inspired by spatie/laravel-permission.