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.
  • 相关阅读:
    js-排序算法
    django csrf token添加
    django mongodb配置
    django logging
    linux文件行首行尾添加或替换
    linux 大小写转化
    linux $参数
    mysql 基本操作
    生产者消费者示例
    python smtplib发email
  • 原文地址:https://www.cnblogs.com/Farmer-D/p/8144414.html
Copyright © 2011-2022 走看看