Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

fadilxcoder/phinx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHINX

Notes

  • Install using cmd : composer require robmorgan/phinx

  • Create directory in project files : db/migrations & db/seeds

  • Initialization : vendor/bin/phinx init

  • Database configs located in phinx.php

  • Creating a migration : vendor/bin/phinx create UserMigration - will create file YYYYMMDDHHMMSS_user_migration.php in db/migrations

  • Add codes in change() method of the newly created file

  • Executing a migration : vendor/bin/phinx migrate -e development , in development environment

  • Creating a table seeder : vendor/bin/phinx seed:create UserSeeder - will create file in db/seeds

  • Add codes in run() method in UserSeeder class

  • Execute the seeder : vendor/bin/phinx seed:run

  • Print the queries to standard output without executing them vendor/bin/phinx rollback --dry-run

  • vendor/bin/phinx status - list of all migrations

  • Adding a column to table through migration - vendor/bin/phinx migrate -t 20211114101311XXXXXXXX

  • Executing specific seeder : vendor/bin/phinx seed:run -s UserCompanySeeder

Usage

  • vendor/bin/phinx seed:run

  • vendor/bin/phinx seed:run -s UserCompanySeeder

  • vendor/bin/phinx migrate -t 20211114083508 & vendor/bin/phinx seed:run -s UserSeeder

About

Phinx database migrations

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages