__EFMigrationsHistory
테이블의 스키마를 EntityFramework Core에서 변경할 수 있습니까?Entity Framework "__EFMigrationsHistory"테이블의 코어 변경 스키마
7
A
답변
14
이 UseSqlServer
로 호출을 수행 내부 사용자 마이그레이션 테이블 및 스키마 이름을 구성 할 수 있습니다.
optionsBuilder
.UseSqlServer(
"...",
x => x.MigrationsHistoryTable(
HistoryRepository.DefaultTableName,
"mySchema"));
8
소스 코드 (HistoryRepository.cs)를 들여다 보면. 당신은 DbContext constructor
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
{
var relationalOptions = RelationalOptionsExtension.Extract(options);
relationalOptions.MigrationsHistoryTableName = "bar";
relationalOptions.MigrationsHistoryTableSchema = "foo";
}
내부 또는 OnConfiguring method
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
var relationalOptions = RelationalOptionsExtension.Extract(optionsBuilder.Options);
relationalOptions.MigrationsHistoryTableName = "bar";
relationalOptions.MigrationsHistoryTableSchema = "foo";
}
+0
매우 가깝습니다. 나는 그 대답을 한 걸음 더 나아 갔다. – bricelam
+0
MS가 다음과 같이 변경 한 것 같습니다. WithMigrationsHistoryTableName ("bar") 및 WithMigrationsHistoryTableSchema ("foo"). –
관련 문제
- 1. Entity Framework 스키마 이름 변경
- 2. Entity Framework 코어의 동적 스키마 변경
- 3. Entity Framework 사용자 계정 - 스키마 변경
- 4. Entity Framework 코드 우선 엔터티마다 스키마 구성
- 5. Entity Framework 스키마 유효성 검사 실패
- 6. Entity Framework 모델에서 DB 스키마 작성
- 7. Entity Framework - 관계 변경 다중성
- 8. Entity Framework 4의 ConnectionString 변경
- 9. 구성에서 Entity Framework 공급자 변경
- 10. Entity Framework (3.5) - 변경 거부
- 11. Entity Framework 코어 1.0.1 추가 마이그레이션
- 12. Entity Framework 열 이름의 코어 불일치
- 13. Entity Framework 6 + SQLSpatialFunctions
- 14. Entity Framework 역 엔지니어링
- 15. Entity Framework 코드에서 첫 번째 자동화 된 스키마 마이그레이션
- 16. Entity Framework 6에서 데이터베이스의 변경 내용을 저장하십시오.
- 17. Entity Framework 4.0에서 ObjectSet의 변경 사항을 감지합니까?
- 18. Entity Framework 4.3의 기본 ErrorMessage 변경
- 19. Entity Framework 및 log4net에 대한 app.config 변경
- 20. Entity Framework 4.1에서 연결 문자열 변경 POCO
- 21. Entity Framework 4.1에서 엔터티 상태 변경
- 22. 런타임시 Entity Framework 5 로그 데이터베이스 변경
- 23. Entity Framework - 자동 변경 감지의 이점은 무엇입니까?
- 24. Entity Framework 4의 변경 사항 취소 POCO
- 25. Entity Framework 및 코드로 런타임에 데이터베이스 변경
- 26. Entity Framework 5 변경 내용 추적
- 27. NopCommerce 1.90의 Entity Framework 4.0 변경 사항
- 28. Entity Framework, 열을 읽기 전용으로 변경
- 29. Entity Framework : 변경 사항이 발생하면 데이터 다시로드
- 30. Entity Framework - 부분 커밋
좋은 것. 단순합니다. 감사. –
@bricelam 또한 마이그레이션 기록 테이블의 열 이름을 변경할 수 있습니까? –
@AlexBello [블로그 게시물에 올라와 있습니다] (http://www.bricelam.net/2017/01/04/efcore-history-table.html). – bricelam