You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if this issue is your responsibility or DBIx::Class's, but here it is:
I have changed DB from MySQL to MariaDB. I am also using DBIx::Class. So, I am using DBIx::Class::Storage::DBI::MariaDB you kindly provided in order to take care of the missing loader for MariaDB.
I have noticed that in the produced schema files with MySQL loader the primary key is set explicitly with this: __PACKAGE__->set_primary_key("id");. But with MariaDB loader the said declaration is missing and now I have:
The above perhaps are equivalent but DBIx::Class complains with:
Error: {UNKNOWN}: DBIx::Class::ResultSource::_pri_cols_or_die(): Operation requires a primary key to be declared on 'MyApp::Schema::XYZ' via set_primary_key ...
As if there is no primary key set.
This error disappears when I explicitly add a __PACKAGE__->set_primary_key("id"); in the custom-code section of the schema file.
EDIT after 30mins: Furthermore the primary key set via the constraint is not auto-incremented even if my SQL is something like:
CREATE TABLE IF NOT EXISTS XYZ (
id mediumint unsigned NOT NULL primary key auto_increment,
...
) AUTO_INCREMENT=1;
The text was updated successfully, but these errors were encountered:
Did you manage to figure out what was causing this?
I'm not sure this is related to DBIx::Class::Storage::DBI::MariaDB since we don't change anything regarding Schema::Loader. I think you'll need to look at https://metacpan.org/pod/DBIx::Class::Schema::Loader::DBI::mysql, you may need to port that to MariaDB.
Could you provide steps I can use to reproduce this issue? (E.g. a command line / code example)
I am not sure if this issue is your responsibility or DBIx::Class's, but here it is:
I have changed DB from MySQL to MariaDB. I am also using DBIx::Class. So, I am using DBIx::Class::Storage::DBI::MariaDB you kindly provided in order to take care of the missing loader for MariaDB.
I have noticed that in the produced schema files with MySQL loader the primary key is set explicitly with this:
__PACKAGE__->set_primary_key("id");
. But with MariaDB loader the said declaration is missing and now I have:The above perhaps are equivalent but DBIx::Class complains with:
As if there is no primary key set.
This error disappears when I explicitly add a
__PACKAGE__->set_primary_key("id");
in the custom-code section of the schema file.EDIT after 30mins: Furthermore the primary key set via the constraint is not auto-incremented even if my SQL is something like:
The text was updated successfully, but these errors were encountered: