# Add a second tenant

## 1. Create the tenant

```sh
quill tenant create --field user_id --table public.users
```

## 2. Map it to the first tenant

```sh
quill tenant update --field user_id --maps-to organization_id
```

## 3. Add the tenant to a virtual table

```sh
quill schema update --name orders \
  --sql "SELECT organization_id, user_id, id, category, amount, created_at FROM public.orders" \
  --tenant-fields organization_id --tenant-fields user_id
```

## 4. Add a tenant filter to a dashboard

```sh
quill dashboard update --name Sales --tenant-filter
```

## 5. Create a dashboard for the new tenant

```sh
quill dashboard create --name "My orders" --owner-tenant user_id
```
