3 using Microsoft.EntityFrameworkCore;
4 using Microsoft.EntityFrameworkCore.Infrastructure;
5 using Microsoft.EntityFrameworkCore.Metadata;
6 using Microsoft.EntityFrameworkCore.Migrations;
10 namespace KlusterKite.NodeManager.ConfigurationSource.Migrations
19 .HasAnnotation(
"ProductVersion",
"1.1.2");
21 modelBuilder.Entity(
"KlusterKite.NodeManager.Client.ORM.CompatibleTemplate", b =>
24 .ValueGeneratedOnAdd()
25 .HasColumnType(
"serial");
27 b.Property<
int>(
"CompatibleConfigurationId");
29 b.Property<
int>(
"ConfigurationId");
31 b.Property<
string>(
"TemplateCode");
35 b.HasIndex(
"CompatibleConfigurationId");
37 b.HasIndex(
"ConfigurationId");
39 b.ToTable(
"CompatibleTemplate");
42 modelBuilder.Entity(
"KlusterKite.NodeManager.Client.ORM.Configuration", b =>
45 .ValueGeneratedOnAdd()
46 .HasColumnType(
"serial");
48 b.Property<DateTimeOffset>(
"Created");
50 b.Property<DateTimeOffset?>(
"Finished");
52 b.Property<
bool>(
"IsStable");
54 b.Property<
int>(
"MajorVersion");
56 b.Property<
int>(
"MinorVersion");
58 b.Property<
string>(
"Name");
60 b.Property<
string>(
"Notes");
62 b.Property<
string>(
"SettingsJson");
64 b.Property<DateTimeOffset?>(
"Started");
66 b.Property<
int>(
"State");
70 b.ToTable(
"Configurations");
73 modelBuilder.Entity(
"KlusterKite.NodeManager.Client.ORM.Migration", b =>
76 .ValueGeneratedOnAdd()
77 .HasColumnType(
"serial");
79 b.Property<DateTimeOffset?>(
"Finished");
81 b.Property<
int>(
"FromConfigurationId");
83 b.Property<
bool>(
"IsActive");
85 b.Property<DateTimeOffset>(
"Started");
87 b.Property<
int>(
"State");
89 b.Property<
int>(
"ToConfigurationId");
93 b.HasIndex(
"FromConfigurationId");
95 b.HasIndex(
"ToConfigurationId");
97 b.ToTable(
"Migrations");
100 modelBuilder.Entity(
"KlusterKite.NodeManager.Client.ORM.MigrationLogRecord", b =>
102 b.Property<
int>(
"Id")
103 .ValueGeneratedOnAdd()
104 .HasColumnType(
"serial");
106 b.Property<
int>(
"ConfigurationId");
108 b.Property<
string>(
"DestinationPoint");
110 b.Property<
string>(
"ErrorStackTrace");
112 b.Property<DateTimeOffset?>(
"Finished");
114 b.Property<
string>(
"Message");
116 b.Property<
int?>(
"MigrationId");
118 b.Property<
string>(
"MigratorName");
120 b.Property<
string>(
"MigratorTemplateCode");
122 b.Property<
string>(
"MigratorTemplateName");
124 b.Property<
string>(
"MigratorTypeName");
126 b.Property<
string>(
"ResourceCode");
128 b.Property<
string>(
"ResourceName");
130 b.Property<
string>(
"SourcePoint");
132 b.Property<DateTimeOffset>(
"Started");
134 b.Property<
int>(
"Type");
138 b.HasIndex(
"ConfigurationId");
140 b.HasIndex(
"MigrationId");
142 b.ToTable(
"MigrationLogRecords");
145 modelBuilder.Entity(
"KlusterKite.NodeManager.Client.ORM.Role", b =>
147 b.Property<
Guid>(
"Uid")
148 .ValueGeneratedOnAdd();
150 b.Property<
string>(
"AllowedScopeJson");
152 b.Property<
string>(
"DeniedScopeJson");
154 b.Property<
string>(
"Name");
161 modelBuilder.Entity(
"KlusterKite.NodeManager.Client.ORM.RoleUser", b =>
163 b.Property<
Guid>(
"UserUid");
165 b.Property<
Guid>(
"RoleUid");
167 b.Property<
int>(
"Id")
168 .ValueGeneratedOnAdd()
169 .HasColumnType(
"serial");
171 b.HasKey(
"UserUid",
"RoleUid");
173 b.HasAlternateKey(
"Id");
175 b.HasIndex(
"RoleUid");
177 b.ToTable(
"RoleUsers");
180 modelBuilder.Entity(
"KlusterKite.NodeManager.Client.ORM.User", b =>
182 b.Property<
Guid>(
"Uid")
183 .ValueGeneratedOnAdd();
185 b.Property<DateTimeOffset?>(
"ActiveTill");
187 b.Property<DateTimeOffset?>(
"BlockedTill");
189 b.Property<
bool>(
"IsBlocked");
191 b.Property<
bool>(
"IsDeleted");
193 b.Property<
string>(
"Login");
195 b.Property<
string>(
"Password");
204 modelBuilder.Entity(
"KlusterKite.NodeManager.Client.ORM.CompatibleTemplate", b =>
206 b.HasOne(
"KlusterKite.NodeManager.Client.ORM.Configuration",
"CompatibleConfiguration")
207 .WithMany(
"CompatibleTemplatesForward")
208 .HasForeignKey(
"CompatibleConfigurationId")
209 .OnDelete(DeleteBehavior.Cascade);
211 b.HasOne(
"KlusterKite.NodeManager.Client.ORM.Configuration",
"Configuration")
212 .WithMany(
"CompatibleTemplatesBackward")
213 .HasForeignKey(
"ConfigurationId")
214 .OnDelete(DeleteBehavior.Cascade);
217 modelBuilder.Entity(
"KlusterKite.NodeManager.Client.ORM.Migration", b =>
219 b.HasOne(
"KlusterKite.NodeManager.Client.ORM.Configuration",
"FromConfiguration")
221 .HasForeignKey(
"FromConfigurationId")
222 .OnDelete(DeleteBehavior.Cascade);
224 b.HasOne(
"KlusterKite.NodeManager.Client.ORM.Configuration",
"ToConfiguration")
226 .HasForeignKey(
"ToConfigurationId")
227 .OnDelete(DeleteBehavior.Cascade);
230 modelBuilder.Entity(
"KlusterKite.NodeManager.Client.ORM.MigrationLogRecord", b =>
232 b.HasOne(
"KlusterKite.NodeManager.Client.ORM.Configuration",
"Configuration")
233 .WithMany(
"MigrationLogs")
234 .HasForeignKey(
"ConfigurationId")
235 .OnDelete(DeleteBehavior.Cascade);
237 b.HasOne(
"KlusterKite.NodeManager.Client.ORM.Migration",
"Migration")
239 .HasForeignKey(
"MigrationId");
242 modelBuilder.Entity(
"KlusterKite.NodeManager.Client.ORM.RoleUser", b =>
244 b.HasOne(
"KlusterKite.NodeManager.Client.ORM.Role",
"Role")
246 .HasForeignKey(
"RoleUid")
247 .OnDelete(DeleteBehavior.Cascade);
249 b.HasOne(
"KlusterKite.NodeManager.Client.ORM.User",
"User")
251 .HasForeignKey(
"UserUid")
252 .OnDelete(DeleteBehavior.Cascade);
Configuration database context
override void BuildTargetModel(ModelBuilder modelBuilder)
The history record describing cluster migration