Seed Database

We will run our seed file and populate our database

Seed database#

The AbstractSeed class in the populate_entry_table.ts file contains the same client as the migration class, so we can simply use JavaScript to create some random data. We will just be mocking some data and hardcoding it into objects, but you can also use a fake data library such asfaker.js to generate random data.

Add the following code to your run method.

 

This page is a preview of Build and deploy a REST API with Deno

Start a new discussion. All notification go to the author.