Database seeding


Database seeding is the initial seeding of a database with data. Seeding a database is a process in which an initial set of data is provided to a database when it is being installed. It is especially useful when we want to populate the database with data we want to develop in future. This is often an automated process that is executed upon the initial setup of an application. The data can be dummy data or necessary data such as an initial administrator account.

Entity Framework

\Migrations\Configuration.cs

public class ApplicationDatabaseInitializer : DropCreateDatabaseIfModelChanges

Symfony PHP Framework

AppBundle/DataFixtures/ORM/customer.yml

AppBundle\Entity\User:
customer_:
username:
email:
plainPassword: theLetterA
roles:
enabled: true

Laravel PHP Framework

app/database/seeds/users.php

class DatabaseSeeder extends Seeder
class UserTableSeeder extends Seeder