123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using Microsoft.EntityFrameworkCore;
-
- namespace Luticate2.Auth.Tests.DataAccess.Crud.Models
- {
- public partial class luticate2_unit_testsContext : DbContext
- {
- public luticate2_unit_testsContext()
- {
- }
-
- public luticate2_unit_testsContext(DbContextOptions<luticate2_unit_testsContext> options)
- : base(options)
- {
- }
-
- public virtual DbSet<table_simple_1> table_simple_1 { get; set; }
-
- protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
- {
- if (!optionsBuilder.IsConfigured)
- {
- #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.
- optionsBuilder.UseNpgsql("Host=localhost;Database=luticate2_unit_tests;Username=dev;Password=dev");
- }
- }
-
- protected override void OnModelCreating(ModelBuilder modelBuilder)
- {
- modelBuilder.HasPostgresExtension("uuid-ossp");
-
- modelBuilder.Entity<table_simple_1>(entity =>
- {
- entity.Property(e => e.id).HasDefaultValueSql("uuid_generate_v1()");
-
- entity.Property(e => e.comment).IsRequired();
-
- entity.Property(e => e.created_at).HasColumnType("timestamp with time zone");
-
- entity.Property(e => e.name).IsRequired();
-
- entity.Property(e => e.updated_at).HasColumnType("timestamp with time zone");
- });
- }
- }
- }
|