protected function buildCommands(Db $db)
    {
        $columns = $db->describeColumns($this->table, $this->schema);
        foreach ($this->columns as $column) {
            $this->buildIndexAndForeignFromFluentColumn($column);

            foreach ($columns as $c) {
                if ($c->getName() === $column->get('name')) {
                    $this->addCommand('modifyColumn', ['column' => $column, 'from' => $c]);
                    continue 2;
                }
            }

            $this->addCommand('addColumn', ['column' => $column]);
        }

        foreach ($this->indexes as $index) {
            $command = $index->get('type') === 'PRIMARY'
                ? 'addPrimary'
                : 'addIndex';

            $this->addCommand($command, ['index' => $index]);
        }

        foreach ($this->references as $reference) {
            $this->addCommand('addForeign', ['reference' => $reference]);
        }
    }