library phinx-csv-seeder
A simple way to seed your database from a csv file using phinx
backendtea/phinx-csv-seeder
A simple way to seed your database from a csv file using phinx
- Tuesday, December 19, 2017
- by BackEndTea
- Repository
- 1 Watchers
- 1 Stars
- 42 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 1 Open issues
- 2 Versions
- 180 % Grown
Phinx Csv Seeder
, (*1)
Instalation
$ composer require backendtea/phinx-csv-seeder
Requirements
- PHP 5.6 or higher
- robmorgan/phinx version 0.8.1 or higher
Usage
Basic usage:, (*2)
<?php
use BackEndTea\MigrationHelper\CsvSeeder;
class UserSeeder extends CsvSeeder
{
public function run()
{
$this->insertCsv('users', __DIR__ . '/users.csv');
}
}
Will try and insert all csv records into the given table. The keys in the csv file are required
to match the keys in the database. Any values for a row not specified become their defaults., (*3)
dev-master
9999999-dev
A simple way to seed your database from a csv file using phinx
Sources
Download
MIT
The Requires
The Development Requires
v0.0.1
0.0.1.0
A simple way to seed your database from a csv file using phinx
Sources
Download
MIT
The Requires
The Development Requires