ODP.NET Entity Framework Core Beta 3 Datetime field — oracle-tech

    Forum Stats

  • 3,716,134 Users
  • 2,242,961 Discussions
  • 7,845,841 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

ODP.NET Entity Framework Core Beta 3 Datetime field

4013419
4013419 Member Posts: 3
edited July 2019 in ODP.NET

I'm using ODP.NET Entity Framework Core Beta 3 with migrations and I'm getting an error when adding a new field of DateTime type. When It is the creation of the table it works fine but when its an update, the command  'dotnet ef database update' throws an error wich says "the right parenthesis is missing".

The SQL Generated in update is:

ALTER TABLE <TABLE> add <FIELD_NAME> Timestamp(7) DEFAULT TO_DATE(''0001-01-01 00:00:00'', ''YYYY-MM-DD HH24:MI:SS'') NOT NULL

It is probably a bug of this version. Is it possible to do anything to fix it manually/temporarelly?
Is there a way to require a fix for a future version?

Thanks.

Best Answer

Answers

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited June 2019

    The Beta 4 is now available on NuGet. Please try that version to see if the problem reproduces. If it does still reproduce, can you provide steps and sample model to reproduce the problem?

  • 4013419
    4013419 Member Posts: 3
    edited June 2019

    Hi Alex, ODP.NET Entity Framework Core Beta 3 Datetime field

    I updated to beta-4 and it still happens

    Reprodution:

    Requirements:
    - Oracle 11g Database
    -.NET Core Project with configured ODP.NET Entity Framework Core Beta-4
    - At least one Entity
    - Initial migration already applied to the database

    Steps:

    1. Choose one of your Entities and add a DateTime property:
        Ex:
                  [Column("DATETEST")]
                 public DateTime DateTest { get; set; }

    Add a new migration in order to update your database afterwards

       Ex:

             Run command:

                'dotnet ef migrations add datetime_test'

    2. Add a new migration in order to update your database afterwards
        Ex:
              Run command:
                 'dotnet ef migrations add datetime_test'

    1.PNG

    3. Try to update your database:
         Ex:
              Run command:
               'dotnet ef database update'

    * Current Behaviour:

        ORA-00907: Right parenthesis is missing

    2.PNG

    * Expected Behaviour:
        Update the database adding the new DateTime field.

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited June 2019

    Thanks for the detailed steps. What version of Oracle Database 11g are you using: 11.1 or 11.2?

  • 4013419
    4013419 Member Posts: 3
    edited June 2019

    The version is:

    Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited June 2019 Accepted Answer

    Thanks! I filed Bug 29869460 to have the issue reviewed and fixed.

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited June 2019

    One of my developers fixed this bug. We plan to put the fix into the production release.

  • 621e15e4-d5fe-4645-b1fe-9200a32b1fb2
    edited July 2019

    Hello

    Thank you very much for your job, it helped me a lot

    When are you planing to realize the final release?

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited July 2019
Sign In or Register to comment.