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
14
votes
3 answers

Dynamically add columns in an existing table on the fly in CakePHP 3

I want to add column in my existing table in CakePHP 3. My ContactsTable.php file code:
Jigar Dhaduk
  • 652
  • 1
  • 5
  • 23
10
votes
1 answer

How do you change the Collation of a column using Phinx

I just started learning Phinx, and I am needing to change the collation of a column to latin1_swedish_ci. I'm not finding documentation on how to do this. I'm assuming it would be similar to: ->addColumn('text_two', 'string', ['collation' =>…
hjcoder18
  • 449
  • 1
  • 5
  • 13
8
votes
1 answer

TYPO3 Composer dependency conflict

I'll be brief: I have a TYPO3 with composer installed. Let us have a look at the require part from TYPO3. "require": { "php": ">=5.5.0", "ext-fileinfo": "*", "ext-json": "*", "ext-pcre": "*", "ext-session": "*", "ext-xml":…
TatzyXY
  • 505
  • 1
  • 6
  • 13
8
votes
2 answers

Adding a 'enum' MySQL field type with Phinx Migrate

I'm trying to create a migration in Phinx (actually a rollback) which will create a enum type field in a MySQL DB. Having read the docs I was under the impression that this should be pretty simple but it just fails every time. $table =…
Nathan Pitman
  • 2,286
  • 4
  • 30
  • 46
7
votes
1 answer

How to rollback a specific migration in Cakephp?

I am working on migrations in Cakephp3, I want to rollback a specific migration, I know how to rollback a previous migration by using the follow way: bin/cake migrations rollback But I couldn't find a way to rollback a specific migration. Note: I…
Amrinder Singh
  • 5,300
  • 12
  • 46
  • 88
6
votes
1 answer

How is it possible to use Phinx without migrations?

I would like to synchronize the states of multiple databases. I would like to compare the tables in them, and create the missing tables and columns. There is a library for Php, which has a lot of functions for database manipulation: Phinx…
Iter Ator
  • 8,226
  • 20
  • 73
  • 164
6
votes
4 answers

Cant create migration phinx

When I try create migration I get this exception, but I have not got curly braces in my migration path [Exception] You probably used curly braces to define the migration path in your Phinx configuration file, but no directories have been matched…
6
votes
1 answer

How do you escape strings when writing data Migrations in Phinx?

I've got some simple updates inside my migration with strings that may contain special characters. For example: $this->execute("UPDATE `setting` SET `classname` = 'org\foo\Bar' WHERE `id` = 1 "); The problem with this for example, org\foo\Bar when…
Ray
  • 40,256
  • 21
  • 101
  • 138
5
votes
1 answer

How to use phinx migration tool with codeception test framework

I has some experience in client and server side JavaScript apps development. But now i design my first web application on php and look for best development tools stack. I use phinx to share my database structure between testing, development and…
user3414982
  • 357
  • 1
  • 4
  • 15
4
votes
1 answer

How to set visible length for type tinyint,smallint while alter column using phinx migration in cakephp3?

I tried the following code to migrate a field "exp" to datatype tinyint(2), i want to make visible-length 2 with datatype tinyint. $table->changeColumn('exp', 'integer', [ 'limit' => MysqlAdapter::INT_TINY, //is there any option to set…
D Coder
  • 331
  • 2
  • 10
4
votes
1 answer

Adding Foreign Key using Phinx

I know there has been a couple of posts similar to this one, but they are not giving me the answer I need. So, I'm using Phinx and I am trying to add a foreign key, but I get the following error: General error: 1215 Cannot add foreign key…
hjcoder18
  • 449
  • 1
  • 5
  • 13
4
votes
1 answer

CakePHP 3 migration missing enum

I have a question; Has anyone experienced to migrate a table using CakePHP 3 Migration Tool that when a specific field is an ENUM data type, the migration script automatically converts it into string or text. How can I avoid it and how can I…
bowmeow
  • 109
  • 1
  • 11
4
votes
1 answer

Biginteger auto_increment primary key Phinx

I am trying to create a migration with a biginteger-primary key and switch it to auto_increment. I am using robmorgans Phinx to create the migration. Is it possible to change a table's primary key of the datatype BIGINTEGER to be auto_incremented…
JazzCat
  • 4,243
  • 1
  • 26
  • 40
4
votes
1 answer

It is possible to set the default schema used by phinx, in php, to create the default_migration_table?

I'm using phinx in my project and i'm trying to change the schema of default_migration_table, something like this: environments: default_migration_table: mySchema.phinxlog #default schema is public default_database: development ... But it…
Victor
  • 5,043
  • 3
  • 41
  • 55
3
votes
1 answer

The file "phinx.yml" does not exist

I setup phinx using the --format php during the init. It is in the /config/database folder as database.php Whenever I try to run the migration I get the following error. The file "phinx.yml" does not exist. I'm now using a .yml file. My…
TheDizzle
  • 1,534
  • 5
  • 33
  • 76
1
2 3 4 5 6 7