Database

Stellify provides a suite of endpoints that allow you to execute database routines such as migrations and rollbacks.


POST/v1/database/migrations/run

Run Migrations

This endpoint allows you run migrations that currently exist in your migrations directory.

Request

POST
/v1/database/migrations/run
curl https://api.stellify.com/v1/database/migrations/run \
  -H "Authorization: Bearer {token}"
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.database.migrations.run()
from stellify_api import ApiClient

client = ApiClient(token)

client.database.migrations.run()
$client = new \Stellify\ApiClient($token);

$client->database->migrations->run();

Response

{
    "status": "200",
    "message": "Migrations complete"
}

POST/v1/database/factory/run

Run Factory

This endpoint allows you run a factory that currently exist in your factories directory.

Required attributes

  • Name
    file_id
    Type
    string
    Description

    The id of the factory file you wish to execute.

Request

POST
/v1/database/factory/run
curl https://api.stellify.com/v1/database/factory/run \
  -H "Authorization: Bearer {token}" \
  -d file_id="4496917c-e668-4fda-a12a-d4ce7bfdbb8a" 
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.database.factory.run("4496917c-e668-4fda-a12a-d4ce7bfdbb8a")
from stellify_api import ApiClient

client = ApiClient(token)

client.database.factory.run("4496917c-e668-4fda-a12a-d4ce7bfdbb8a")
$client = new \Stellify\ApiClient($token);

$client->database->factory->run("4496917c-e668-4fda-a12a-d4ce7bfdbb8a");

Response

{
    "status": "200",
    "message": "Factory created"
}

POST/v1/database/seeder/run

Run Seeder

This endpoint allows you run a seeder that currently exist in your factories directory.

Required attributes

  • Name
    file_id
    Type
    string
    Description

    The id of the seeder file you wish to execute.

Request

POST
/v1/database/seeder/run
curl https://api.stellify.com/v1/database/seeder/run \
  -H "Authorization: Bearer {token}" \
  -d file_id="3d6414b5-3c5a-4f0d-aedf-87e50da631ce" 
import ApiClient from '@stellisoft/js-api-client'

const client = new ApiClient(token)

await client.database.seeder.run("3d6414b5-3c5a-4f0d-aedf-87e50da631ce")
from stellify_api import ApiClient

client = ApiClient(token)

client.database.seeder.run("3d6414b5-3c5a-4f0d-aedf-87e50da631ce")
$client = new \Stellify\ApiClient($token);

$client->database->seeder->run("3d6414b5-3c5a-4f0d-aedf-87e50da631ce");

Response

{
    "status": "200",
    "message": "Seeder executed"
}

Please be aware that our API documentation is under construction.