> For the complete documentation index, see [llms.txt](https://mostafaznv.gitbook.io/larupload/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mostafaznv.gitbook.io/larupload/advanced-usage/migrations/heavy-columns.md).

# Heavy Columns

```php
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Mostafaznv\Larupload\Enums\LaruploadMode;

return new class extends Migration {
    public function up()
    {
        Schema::create('uploads', function(Blueprint $table) {
            $table->id();
            $table->upload('file', LaruploadMode::HEAVY);
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('uploads');
    }
};
```

The following columns are created in `HEAVY` mode:

* `file_name`
* `file_id`
* `file_original_name`
* `file_size`
* `file_type`
* `file_mime_type`
* `file_width`
* `file_height`
* `file_duration`
* `file_dominant_color`
* `file_format`
* `file_cover`

These columns store separate information about the file and are useful when you need to perform special queries or sort data.

{% hint style="info" %}
All fields created in `HEAVY` mode are nullable.
{% endhint %}

{% hint style="info" %}
`file_original_name, file_size`, `file_type`, and `file_duration` columns have an index.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mostafaznv.gitbook.io/larupload/advanced-usage/migrations/heavy-columns.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
