Working on tenants and config
This commit is contained in:
parent
c10de11bbe
commit
f3352318f5
12 changed files with 309 additions and 19 deletions
|
|
@ -1,10 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Insight.Database;
|
||||
namespace Database.Tenants
|
||||
{
|
||||
|
|
@ -18,13 +14,13 @@ namespace Database.Tenants
|
|||
_db = db;
|
||||
}
|
||||
|
||||
public async Task CreateTenant(string schema)
|
||||
public async Task CreateTenantInDatabase(string schema, string user, string password)
|
||||
{
|
||||
if (!Regex.IsMatch(schema, "^[a-zA-Z0-9_]+$"))
|
||||
{
|
||||
throw new ArgumentException("Invalid schema name");
|
||||
}
|
||||
|
||||
await CreateUser(user, password);
|
||||
await CreateSchema(schema);
|
||||
await CreateRolesTable(schema);
|
||||
await CreatePermissionsTable(schema);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue