Auto stash before merge of "main" and "origin/main"
This commit is contained in:
parent
21d7128e74
commit
521190475d
41 changed files with 991 additions and 1150 deletions
|
|
@ -1,8 +1,9 @@
|
|||
using System.Data;
|
||||
using System.Text.RegularExpressions;
|
||||
using Database.Common;
|
||||
using Insight.Database;
|
||||
|
||||
namespace Database.Tenants
|
||||
namespace Database.RolesPermissionSystem
|
||||
{
|
||||
public class Setup
|
||||
{
|
||||
|
|
@ -19,7 +20,7 @@ namespace Database.Tenants
|
|||
/// <param name="schema">The schema name where the tables will be created.</param>
|
||||
public async Task CreateSystem(string schema)
|
||||
{
|
||||
if (!IsValidSchemaName(schema))
|
||||
if (!Validations.IsValidSchemaName(schema))
|
||||
throw new ArgumentException("Invalid schema name", nameof(schema));
|
||||
|
||||
using (var transaction = _db.BeginTransaction())
|
||||
|
|
@ -29,7 +30,7 @@ namespace Database.Tenants
|
|||
await CreateRolesTable(schema, transaction).ConfigureAwait(false);
|
||||
await CreatePermissionsTable(schema, transaction).ConfigureAwait(false);
|
||||
await CreatePermissionTypesTable(schema, transaction).ConfigureAwait(false);
|
||||
await CreateRolePermissionsTable(schema, transaction).ConfigureAwait(false);
|
||||
await CreateRolePermissionsTable(schema, transaction).ConfigureAwait(false);
|
||||
|
||||
transaction.Commit();
|
||||
}
|
||||
|
|
@ -41,10 +42,6 @@ namespace Database.Tenants
|
|||
}
|
||||
}
|
||||
|
||||
private bool IsValidSchemaName(string schema)
|
||||
{
|
||||
return !string.IsNullOrEmpty(schema) && Regex.IsMatch(schema, "^[a-zA-Z0-9_]+$");
|
||||
}
|
||||
|
||||
private async Task ExecuteSqlAsync(string sql, IDbTransaction transaction)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue