---
tags: [attachments, database]
module: Attachments
---

# DatabaseTables

## Connections
[[_Attachments]] · [[[Model]GeneralAttachment]] · [[[Cross]CrossModuleDependencies]]

## Source
```
Modules/Attachments/Database/Migrations/tenancy/
  2021_05_20_141734_create_general_attachments_table.php
```

## `general_attachments`

| Column | Type | Notes |
|---|---|---|
| id | bigIncrements | PK |
| title | string | File label |
| type | string | MIME type |
| path | text | Storage path |
| size | unsignedBigInteger | File size in bytes |
| is_attached | boolean | `false` = staged, `true` = linked to document |
| added_by | unsignedBigInteger | FK → users.id |
| deleted_by | unsignedBigInteger (nullable) | FK → users.id |
| customer_id | unsignedBigInteger (nullable) | FK → customers.id |
| supplier_id | unsignedBigInteger (nullable) | FK → suppliers.id |
| invoice_id | unsignedBigInteger (nullable) | FK → invoices.id |
| bill_id | unsignedBigInteger (nullable) | FK → purchase_bills.id |
| expense_id | unsignedBigInteger (nullable) | FK → expenses.id |
| deleted_at | timestamp (nullable) | Soft delete |
| created_at / updated_at | timestamps | — |
