Error creating schema from model when using MariaDB and bigint unsigned

5 posts, 0 answers
  1. Nic
    Nic avatar
    21 posts
    Member since:
    Oct 2012

    Posted 12 Sep 2014 Link to this post

    Using Data Access to create a database from the model using MariaDB 10.x

    For some fields I have defined then as bigint unsigned as I am using Uint64 as the type in the model.

    When the DDL is generated the statement for these fields is output as:

     `Id` bigint unsigned(20) AUTO_INCREMENT NOT NULL, -- _id

    this causes an error from MariaDB as the line should read

    Id` bigint(20) unsigned AUTO_INCREMENT NOT NULL, -- _id

    Any idea if this has been fixed or if a work around exists?

    Thanks

    Nic
  2. Nic
    Nic avatar
    21 posts
    Member since:
    Oct 2012

    Posted 12 Sep 2014 Link to this post

    It seems that bigint types with MariaDB may also be a problem:

    I've changed my bigint unsigned to bigint and now the create script will run but when I attempt to update the database from the model I get the following error:

    "The migration of a primary key to a different type is not supported. PrimaryKey column Id of table 'test' is modelled as bigint(20). Database has bigint."

    I've looked at the created table in MariaDB and it is a bigint with a length/set of 20.
  3. DevCraft banner
  4. Nic
    Nic avatar
    21 posts
    Member since:
    Oct 2012

    Posted 15 Sep 2014 in reply to Nic Link to this post

    So finally figured this out - it seems that Data Access is setting the type to Decimal for a UInt64 which Maria isn't happy about. I changed this to bigint unsigned but DA leaves the precision at 20 (which was what it had set for the decimal). Changing the precision back to 0 solves all my problems.
  5. Ady
    Admin
    Ady avatar
    589 posts

    Posted 17 Sep 2014 Link to this post

    Hello Nic,

    I am glad that you were able to find a workaround to the problem. We will investigate into the mapping issue for bigint unsigned and keep you updated.

    Regards,
    Ady
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
  6. Ady
    Admin
    Ady avatar
    589 posts

    Posted 19 Nov 2014 Link to this post

    Hello Nic,

     Sorry for the delayed reply.
    A bug entry has been created for this and we will schedule a fix for it soon.
    We will update you when it has been fixed.

    Regards,
    Ady
    Telerik
     
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
     
Back to Top
DevCraft banner