Skip to content

Function: createRbacTables() ​

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

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

Creates the five rbac-evolution tables (plus constraints and indexes) for the given dialect. Tables that already exist are skipped, so it is safe to call more than once.

ts
await createRbacTables(db)                                  // dialect detected
await createRbacTables(db, { dialect: 'mysql', prefix: 'rbac_' })

Parameters ​

ParameterType
dbKysely<any>
options?RbacMigrationOptions

Returns ​

Promise<void>

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