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
1
vote
1 answer

Phinx and pt-online-schema-change

Does Phinx support pt-online-schema-change? I realize Phinx is supposed to handle DB migrations. But in the live environment, running a simple ALTER TABLE command on a huge table might lead to a table lock and temporary service unavailability. There…
Pavel S.
  • 11,892
  • 18
  • 75
  • 113
0
votes
0 answers

Set new column as first column of table

I'd like to use the MysqlAdapter::FIRST constant of phinx to set a new column as first column in a new table. The migration does run through, but does not set the desired column as first column. I already checked the documentation and had a look at…
0
votes
1 answer

Write drop foreign keys with Phinx

I'm trying to write this migration using only up and down method, but I'm getting this error. SQLSTATE[HY000]: General error: 1553 Cannot drop index 'transaction_id': needed in a foreign key constraint
user15403926
0
votes
1 answer

modify enum values in migrations scripts

Is there a correct and safe way to modify enum column type values? Add new or remove old. E.g.: I have ENUM ("apple", "banana") I have 2 tasks that need to add value to the ENUM. 1 needs to add orange and second needs to add peach. If I get…
tttpapi
  • 887
  • 2
  • 9
  • 32
0
votes
1 answer

Required specifics to ensure migration rollback

For proper migration rollback (either through errors or manual operation), does one need to implement specific things in the migration to ensure this can be done? For instance, if I only have change(), which has updates, how will it know how to do…
TechFanDan
  • 3,329
  • 6
  • 46
  • 89
0
votes
1 answer

How can I set 'id' as biginteger and autoincrement in phinx for PostgreSQL?

I tried to set as only biginter but it lost its autoincrement properties. So I tried adding auto-increment as well. $table->changeColumn('id', 'biginteger', ['identity' => true])->update(); But it showed error. PDOException: SQLSTATE[42704]:…
0
votes
0 answers

Database migrations using phinx php

I have this migrations but table('peak_times'); $table->addColumn('from_time', 'time') …
Alisher
  • 1
  • 1
0
votes
1 answer

How to set scale and precision for MySQL float column in Phinx migration

I've got a column in a current MySQL table with definition float(3,2) and I need to expand it to be float(4,2). How do I do this with a Phinx (CakePHP) migration column specification?
CXJ
  • 4,301
  • 3
  • 32
  • 62
0
votes
0 answers

Trying to add a foreign key constraint on a column that has null values

I was able to add foreign key constraints on a column when I first made the table, and I had created the column to accept null values. But now that there is data in the table, actual records with null values, it seems I'm unable to add a foreign key…
Blaine Lafreniere
  • 3,451
  • 6
  • 33
  • 55
0
votes
0 answers

Permission denied when migrating in DigitalOcean

I'm using the DigitalOcean terminal to try run a Phinx migration vendor/bin/phinx migrate -e development but I get the error "permission denied" I have tried writing the command in different ways, I have made sure the data in my phinx.php is…
ShlongMór
  • 45
  • 5
0
votes
2 answers

CakePHP 3: can't remove foreign key column using MSSQL driver

I try to remove a column, which is a foreign key: $table = $this->table('users'); $table->removeColumn('province_id'); $table->update(); Above gives DB error: The object 'users_province_id' is dependent on column 'province_id'. If I try to remove…
r34
  • 320
  • 2
  • 12
0
votes
1 answer

Phinx changing migration doesnt create table again

I had a migration that created a table with 2 columns. Ran the migration and it worked. But I realised I would like one of the columns to be a different data type. I dropped the table in my db, changed the migration and ran it again and the table…
TiernO
  • 427
  • 6
  • 20
0
votes
1 answer

How to addColumn character varying(3)[] for Phinx

How do I add a column using Phinx of type character varying(3)[] using their addColumn api? Digging into the source code seems like it might not be a supported feature?
Dan
  • 2,455
  • 3
  • 19
  • 53
0
votes
1 answer

Phinx - custom migration template passing params to the template

I have created a stub/template file I'd like to use for creating migrations
ltdev
  • 4,037
  • 20
  • 69
  • 129
0
votes
1 answer

I need to add a foreign key to Phinx DB migration but it's getting error

I want to add a foreign key to phinx Db migration but it's getting an error. I want to use camping_id in the Bids table as a foreign key from the id of the campaigns table. public function change() { $table = $this->table('bids'); …