Page 1 of 1

Database generation, Oracle, name for Primary Keys and Indexes

Posted: Mon 14 Apr 2014 15:43
by etrich
Hi,

#A) Using EF DB migrations and DotConnect for Oracle, is there a way to customize naming for:

- Primary keys
- Indexes

We've been able to configure naming for:

- Identity sequence and identity trigger (using OracleCreateTableConfiguration)
- Foreign keys (using standard name attribute in DbMigration TableBuilder ForeignKey)

But found no way for primary keys and indexes:

- The standard 'name' attribute on the PrimaryKey builder method does not seem used when generating the database
- We can't find anything to specify index name

#B) If we run a SQL script to configure these names, will we run into trouble when running update migrations (since these scripts make changes that are not included in the db migrations model / serialized state)

Thanks,

Re: Database generation, Oracle, name for Primary Keys and Indexes

Posted: Thu 17 Apr 2014 05:24
by MariiaI
- The standard 'name' attribute on the PrimaryKey builder method does not seem used when generating the database
- We can't find anything to specify index name
Sorry for the delay. We have reproduced the issue with the naming primary keys and indexes. We will investigate it and inform you about the results as soon as any are available.
Please try the following way:

Code: Select all

CreateTable("SCOTT.TABLE",
                c => new
                    {
                        PK_ID = c.Int(nullable: false),
                        NUMBER = c.Int(nullable: false),
                        DATA = c.String(unicode: false, storeType: "xmltype"),
                    })
               ;
            AddPrimaryKey("SCOTT.TABLE", "PK_ID", "my_pk_name");
            CreateIndex("SCOTT.TABLE", "NUMBER", false, "my_index_name");}
Please tell us if this helps.

Re: Database generation, Oracle, name for Primary Keys and Indexes

Posted: Fri 25 Apr 2014 05:24
by MariiaI
The bug with the explicitly named primary keys in Code-First Migrations, when the primary key is defined via the PrimaryKey() method of the CreateTable() operation, is fixed.

New build of dotConnect for Oracle 8.3.146 is available for download!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=29438.