# Upload Service

This service represents the metadata for the uploaded media assets. It also exposes an upload endpoint, for uploading the assets themselves.

This service is backed by a Postgres database (upload\_service), and table (media).

## Database Migrations

This service uses Postgres as it's core database. You can run migrations using:

### Create a migration

```bash
$ make migrate.create name="my_new_migration"
```

### Migrate up

```bash
$ make migrate.local.up
```

### Migrate production/staging database

```bash
$ make migrate.proxy.up password=<database-password>
```

## Protobuf definition

This service exposes a gRPC + Protobuf server, for certain endpoints/functions. You

The protobuf definition can be found in `./proto`, you can re-build the protobuf definitions `$ make build.proto`.

## Internal gRPC Endpoints

```
ListMedia(ListMediaRequest) ListMediaResponse
GetMedia(GetMediaRequest) GetMediaResponse
```


---

# Agent Instructions: 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://docs.mediamagic.dev/product-docs/services/upload-service.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.
