zoukankan      html  css  js  c++  java
  • EntityFramework ORA-00955 名称已由现有对象使用

    Oracle implementation of Entity framework provider is very poor but there are some ways how to make this working.

    1. Simple but annoying - using NULL or own database initializer implementation:

      Database.SetInitializer<DatabaseContext>(null);
      

    or

    class DatabaseInitializer : IDatabaseInitializer<DatabaseContext>
    {
        public void InitializeDatabase(DatabaseContext context)
        {
            // your implementation
        }
    }
    
    Database.SetInitializer(new DatabaseInitializer());
    

    Set the initialized before first access to your database.

    1. If you want to use migrations create your views and then add migration with ignoring changes, for instance using package console add-migration initial -ignorechanges. This will make EF ignoring the inconsistencies between the DB schema and model (because it checks only tables from ALL_TABLES, not views) so it will not try to create table. There is a bug in Oracle EF implementation that if the initial migration is empty it drops and recreates the __MigrationHistory table so either your initial migration must containt at least one table before you add the view migration or you need to add a table afterwards.
  • 相关阅读:
    Munge
    file upload custom form
    随笔摘要
    生成css 和 清缓存
    drupal commit 原则
    Git reset --hard
    www-data
    301/302的区别
    什么是request_uri
    in_array foreach array_search的性能比较
  • 原文地址:https://www.cnblogs.com/Farmer-D/p/8144414.html
Copyright © 2011-2022 走看看