Questions tagged [phinx]

Database migration tool for PHP apps.

About

Database migrations tool for PHP apps..Phinx is just about migrations without all the bloat of a database ORM system or framework.

Links

GitHub

Phinx

104 questions
2
votes
1 answer

phinx migration 'up' vs. 'change' function

I have used phinx migration and used it's 'up' and 'change' functions but i did'nt notice any difference between them. Below is my migration file.
Abdullah Shoaib
  • 416
  • 1
  • 5
  • 18
2
votes
1 answer

PHP/Phinx - Inserting Longitude/Latitude causes PDO MySQL geometry object error

I'm attempting to create a CitySeeder using Phinx. But I'm getting the following error: [PDOException] SQLSTATE[22003]: Numeric value out of…
BugHunterUK
  • 8,346
  • 16
  • 65
  • 121
2
votes
2 answers

How to set Foreign Key Constraint in Cakephp 3.3 Migration?

I am new to Cakephp and building an application with Cakephp3.3, I am working on Migrations, I have to create a user_infos table, and want to add a new column user_id, I am able to add new columns through migrations but I don't know how to add…
Amrinder Singh
  • 5,300
  • 12
  • 46
  • 88
2
votes
1 answer

how i make foreign key using migrations in cakephp?

I have a table "products" and "intervals" table. In the table "products" I have a column called "intervals_id" need to create a foreign key to the id of the table "intervals". I'm using it, but it's not working: public function up() { …
2
votes
1 answer

Phinx migrate - enum column with default value

While adding phinx migration, Is it possible to addColumn enum with default value? To achieve: 1. All existing rows to have the default value ('active' in this case) 2. All new entries to have the default value ('active' in this case) Something I am…
stack_d_code
  • 1,196
  • 2
  • 12
  • 19
2
votes
2 answers

Phinx - database migrations for php app - postgreSQL schema does not work

I'm using Phinx for databse migrations. It's not workig with PostgreSQL schemas in my case (example test.table). // create the table $table = $this->table('test.table'); $table->addColumn('test', 'integer') ->create(); When i hit phinx…
Piotr
  • 1,777
  • 17
  • 24
2
votes
1 answer

Linux + Phinx + XAMPP = ERROR - need enable PDO_Mysql extension

Could you tell me please, what should I do with this Phinx error. When I tried to run phinx migrate command in console, it throws me an error "You need to enable the PDO_Mysql extension for Phinx to run properly." Environment is Linux, XAMPP, PHP 7.…
Čamo
  • 3,863
  • 13
  • 62
  • 114
2
votes
1 answer

Phinx init does not work

I would like to install Phinx db migrations in my project, but documentation commands do not work. At first it is impossible to run php vendor/bin/phinx init because phinx is not php commant. Ok so I went to bin directory and run phinx.bat but…
Čamo
  • 3,863
  • 13
  • 62
  • 114
2
votes
1 answer

In CakePHP3 migrations (or Phinx), how to use utf8mb4 charset?

Creating MySQL table or adding columns with CakePHP3 migrations, charset is set to UTF8. Is there the way to set charset utf8mb4? (and, i found this issue... https://github.com/robmorgan/phinx/issues/74)
2
votes
2 answers

Installing Phinx on Wamp Server

I want to use "Phinx" in my project using wamp server.I was able to install with cmd: Following instructions at: http://docs.phinx.org/en/latest/install.html composer require robmorgan/phinx But when I run the command: php vendor/bin/phinx…
user4412122
1
vote
0 answers

How I can run specific phinx seeder and get the generated records in phpunit?

I made a phinx seeder: use Phinx\Seed\AbstractSeed; class ManagerRole extends AbstractSeed { /** * Run Method. * * Write your database seeder using this method. * * More information on writing seeders is available…
Dimitrios Desyllas
  • 9,082
  • 15
  • 74
  • 164
1
vote
0 answers

SLIM PHP PHINX cannot do a migration to a MySQL container

I am trying to do a migration with PHINX in a database with a MySQL container, but getting the following issue. PDOException: SQLSTATE[HY000] [2002] Connection refused in…
1
vote
1 answer

Unable to run migrations on GCP with CakePHP 3.8

I am trying to set up my CakePHP 3.8 project on a GCP "Compute Engine" VM. I have set up my app.php to use the following DB configuration: 'className' => 'Cake\Database\Connection', 'driver' => 'Cake\Database\Driver\Mysql', 'persistent' =>…
user4838338
  • 83
  • 1
  • 5
1
vote
1 answer

Cannot add foreign key constraint using phinx

I'm trying to use phinx to add a couple of related tables. I created my migration:
Chris Schmitz
  • 20,160
  • 30
  • 81
  • 137
1
vote
1 answer

phinx "The --configuration option does not exist."

Did something happen to the phinx --configuration option? A project at my work relies on it. phinx docs: If a --configuration command line option is given, Phinx will load the specified file. Otherwise, ... however when I run: $…