oracle / dotnet-db-samples

.NET code samples for Oracle database developers #OracleDotNet
http://otn.oracle.com/dotnet
MIT License
413 stars 191 forks source link

is it possible to specify Tablespace on Entity Framework core OnModelCreating #188

Open omora opened 3 years ago

omora commented 3 years ago

For tables and indexes? Thanks

alexkeh commented 3 years ago

No, there isn't. What are you trying to accomplish by specifying a tablespace?

omora commented 3 years ago

When we apply the migration to create the database table and indexes it generates: -- Create table create table A01ARQ01.ARQ_EMAIL_ADJUNTO ( "Id" RAW(16) not null, "NombreFichero" NVARCHAR2(255), "Binario" BLOB, "EmailId" RAW(16) default '00000000000000000000000000000000' not null ) tablespace ASSM_ARQAUD_DAT; -- Create/Recreate indexes create index INX_ARQ_EMAIL_ADJUNTO_01 on ARQ_EMAIL_ADJUNTO (EmailId) tablespace ASSM_ARQAUD_DAT; -- Create/Recreate primary, unique and foreign key constraints alter table ARQ_EMAIL_ADJUNTO add constraint INX_ARQ_EMAIL_ADJUNTO_PK primary key (ID) using index tablespace ASSM_ARQAUD_DAT; alter table ARQ_EMAIL_ADJUNTO add constraint FK_ARQ_EMAIL_ADJUNTO_ARQ_EMAIL_EmailId foreign key (EMAILID) references ARQ_EMAIL (ID) on delete cascade;

It uses the default tablespace for the schema Our DBA demand to create index tablespaces in a different one create index INX_ARQ_EMAIL_ADJUNTO_01 on ARQ_EMAIL_ADJUNTO (EmailId) tablespace ASSM_ARQAUD_IND; and alter table ARQ_EMAIL_ADJUNTO add constraint INX_ARQ_EMAIL_ADJUNTO_PK primary key (ID) using index tablespace ASSM_ARQAUD_IND;

The work around is not to use migrations and create the tables and index with SQL , the traditional way.

it's a shame that because of this feature we can't use migrations

alexkeh commented 3 years ago

@omora Thanks for brining this to the Oracle EF Core team's attention. I filed an enhancement request (33219678) to have the dev team take a look.

We will prioritize ERs based on customer interest.