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

_to_ in table name #16

Open
seyfer opened this issue Apr 15, 2014 · 1 comment
Open

_to_ in table name #16

seyfer opened this issue Apr 15, 2014 · 1 comment

Comments

@seyfer
Copy link

seyfer commented Apr 15, 2014

If table called like "clients_to_seances"
Then db:generate generates error code

./bash/minion db:generate --name=add_id_to_clients_to_seances

class Add_Id_To_Clients_To_Seances extends Migration
{
    public function up()
    {
        $this->add_column('seances', 'id_to_clients', 'integer');
    }
    public function down()
    {
        $this->remove_column('seances', 'id_to_clients');
    }
}

Expected

class Add_Id_To_Clients_To_Seances extends Migration
{
    public function up()
    {
        $this->add_column('clients_to_seances', 'id', 'integer');
    }
    public function down()
    {
        $this->remove_column('clients_to_seances', 'id');
    }
}
@seyfer
Copy link
Author

seyfer commented Apr 15, 2014

What if i'm want add column names "from" and "to"

./bash/minion db:generate --name=add_from_and_to_to_clients_to_seances

Then i'm have

class Add_From_And_To_To_Clients_To_Seances extends Migration
{
    public function up()
    {
        $this->add_column('seances', 'from', 'string');
        $this->add_column('seances', 'to_to_clients', 'string');
    }

    public function down()
    {
        $this->remove_column('seances', 'from');
        $this->remove_column('seances', 'to_to_clients');
    }
}

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