Adding Schema Support To Phinx
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 4.5k
- Forks
- 884
- PR merge metrics
- No merged PRs in 30d
Description
Looks like phinx just creates/looks for objects in default schema
example: SQL Server Create table will create table in dbo schema. Mysql will create table in database (database same as schema for mysql) that is set in connection property.
`<?php
use Phinx\Migration\AbstractMigration;
class MyNewMigration extends AbstractMigration
{
public function change()
{
$users = $this->table('users', '<schema_name>');
$users->addColumn('username', 'string', ['limit' => 20])
->addColumn('password', 'string', ['limit' => 40])
->addColumn('password_salt', 'string', ['limit' => 40])
->addColumn('email', 'string', ['limit' => 100])
->addColumn('first_name', 'string', ['limit' => 30])
->addColumn('last_name', 'string', ['limit' => 30])
->addColumn('created', 'datetime')
->addColumn('updated', 'datetime', ['null' => true])
->addIndex(['username', 'email'], ['unique' => true])
->create();
}
}`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the AbstractMigration::table() call shown in the issue and trace how its table name is handled. Done means a migration can target a named schema, while existing default-schema behavior remains supported for SQL Server and MySQL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, php
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100