cakephp / cakephp/phinx

Adding Schema Support To Phinx

Open
#2,182 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.