Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Schema Support To Phinx #2182

Open
JRDuncan opened this issue Mar 2, 2023 · 0 comments
Open

Adding Schema Support To Phinx #2182

JRDuncan opened this issue Mar 2, 2023 · 0 comments

Comments

@JRDuncan
Copy link
Contributor

JRDuncan commented Mar 2, 2023

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();
}
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant