Database seeding explained

Database seeding is populating a database with an initial set of data. It is common to load seed data such as initial user accounts or dummy data upon initial setup of an application.

Entity Framework

See main article: Entity Framework. \Migrations\Configuration.cspublic class ApplicationDatabaseInitializer : DropCreateDatabaseIfModelChanges

Entity Framework Core

public class DataSeedingContext : DbContext

Symfony PHP Framework

See main article: Symfony.

AppBundle/DataFixtures/ORM/customer.yml (as in Version 1 of hautelook/AliceBundle)

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

Laravel PHP Framework

See main article: Laravel. app/database/seeds/users.phpclass DatabaseSeeder extends Seeder

class UserTableSeeder extends Seeder

Command line

MySQL

mysql -u username -p database_name < file.sqlPostgreSQL

pg_restore -h hostname -d database_name -U username file.sql

Microsoft SQL Server

sqlcmd -S server_name\instance_name -i file.sql

External links