Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

luticate2_unit_testsContext.cs 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using Microsoft.EntityFrameworkCore;
  2. namespace Luticate2.Auth.Tests.DataAccess.Crud.Models
  3. {
  4. public partial class luticate2_unit_testsContext : DbContext
  5. {
  6. public luticate2_unit_testsContext()
  7. {
  8. }
  9. public luticate2_unit_testsContext(DbContextOptions<luticate2_unit_testsContext> options)
  10. : base(options)
  11. {
  12. }
  13. public virtual DbSet<table_simple_1> table_simple_1 { get; set; }
  14. protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  15. {
  16. if (!optionsBuilder.IsConfigured)
  17. {
  18. #warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.
  19. optionsBuilder.UseNpgsql("Host=localhost;Database=luticate2_unit_tests;Username=dev;Password=dev");
  20. }
  21. }
  22. protected override void OnModelCreating(ModelBuilder modelBuilder)
  23. {
  24. modelBuilder.HasPostgresExtension("uuid-ossp");
  25. modelBuilder.Entity<table_simple_1>(entity =>
  26. {
  27. entity.Property(e => e.id).HasDefaultValueSql("uuid_generate_v1()");
  28. entity.Property(e => e.comment).IsRequired();
  29. entity.Property(e => e.created_at).HasColumnType("timestamp with time zone");
  30. entity.Property(e => e.name).IsRequired();
  31. entity.Property(e => e.updated_at).HasColumnType("timestamp with time zone");
  32. });
  33. }
  34. }
  35. }