This commit is contained in:
Janus Knudsen 2025-03-05 16:56:58 +01:00
parent 91da89a4e8
commit a15cc00595
4 changed files with 20 additions and 36 deletions

View file

@ -22,26 +22,23 @@ namespace PlanTempus.Database.RolesPermissionSystem
/// <param name="schema">The schema name where the tables will be created.</param>
public void CreateSystem()
{
//if (!Validations.IsValidSchemaName(_schema))
// throw new ArgumentException("Invalid schema name", _schema);
using (var transaction = _db.BeginTransaction())
using var transaction = _db.BeginTransaction();
try
{
try
{
CreateRolesTable();
CreatePermissionsTable();
CreatePermissionTypesTable();
CreateRolePermissionsTable();
CreateRolesTable();
CreatePermissionsTable();
CreatePermissionTypesTable();
CreateRolePermissionsTable();
transaction.Commit();
}
catch (Exception ex)
{
transaction.Rollback();
throw new InvalidOperationException("Failed to create system tables.", ex);
}
transaction.Commit();
}
catch (Exception ex)
{
transaction.Rollback();
throw new InvalidOperationException("Failed to create system tables.", ex);
}
}