Skip to content

🐛 It seems that there is an issue with changing primary keys when you try to add sequenced type. #114

Description

@tuneyourserver

No duplicates 🥲.

  • I have searched for a similar issue in our bug tracker and didn't find any solutions.

What happened?

I have the table:

class MyTable
{
    #[Column(type: 'uuid', name: 'uuid', primary: true)]
    private string $id;
}

When trying to add a new column to this table using the following migration command:

public function up(): void
{
    $this->database()->execute("ALTER TABLE my_table ADD COLUMN my_column SERIAL;")
}

I receive the following error when running "php ./app.php cycle:sync":

Detecting schema changes:
• my_db.my_table: 1 change(s) detected
[Cycle\Schema\Exception\SyncException]
Unable to change primary keys for existed table
in vendor/cycle/schema-builder/src/Generator/SyncTables.php:47

Previous: [Cycle\Database\Exception\DBALException]
Unable to change primary keys for existed table
in vendor/cycle/database/src/Driver/Handler.php:66

Also expression like
#[Column(type: 'bigPrimary', name: 'm_index', primary: false)]
not working too.

Thank you.

Version

ORM v2.2.2
PHP 8.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

  • Status
    Released

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions