| | 1 | | using System; |
| | 2 | | using System.Text.Json; |
| | 3 | | using Microsoft.EntityFrameworkCore.Migrations; |
| | 4 | | using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | #pragma warning disable CA1814 // Prefer jagged arrays over multidimensional |
| | 9 | |
|
| | 10 | | namespace Back.Migrations |
| | 11 | | { |
| | 12 | | /// <inheritdoc /> |
| | 13 | | public partial class Bootstrap : Migration |
| | 14 | | { |
| | 15 | | /// <inheritdoc /> |
| | 16 | | protected override void Up(MigrationBuilder migrationBuilder) |
| | 17 | | { |
| 4 | 18 | | migrationBuilder.EnsureSchema( |
| 4 | 19 | | name: "syki"); |
| | 20 | |
|
| 4 | 21 | | migrationBuilder.CreateTable( |
| 4 | 22 | | name: "command_batches", |
| 4 | 23 | | schema: "syki", |
| 4 | 24 | | columns: table => new |
| 4 | 25 | | { |
| 4 | 26 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 27 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 28 | | type = table.Column<string>(type: "text", nullable: false), |
| 4 | 29 | | status = table.Column<string>(type: "text", nullable: false), |
| 4 | 30 | | created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
| 4 | 31 | | processed_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: true), |
| 4 | 32 | | event_id = table.Column<Guid>(type: "uuid", nullable: true), |
| 4 | 33 | | source_command_id = table.Column<Guid>(type: "uuid", nullable: true), |
| 4 | 34 | | next_command_id = table.Column<Guid>(type: "uuid", nullable: true), |
| 4 | 35 | | size = table.Column<int>(type: "integer", nullable: false) |
| 4 | 36 | | }, |
| 4 | 37 | | constraints: table => |
| 4 | 38 | | { |
| 4 | 39 | | table.PrimaryKey("pk_command_batches", x => x.id); |
| 8 | 40 | | }); |
| | 41 | |
|
| 4 | 42 | | migrationBuilder.CreateTable( |
| 4 | 43 | | name: "commands", |
| 4 | 44 | | schema: "syki", |
| 4 | 45 | | columns: table => new |
| 4 | 46 | | { |
| 4 | 47 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 48 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 49 | | type = table.Column<string>(type: "text", nullable: false), |
| 4 | 50 | | data = table.Column<string>(type: "text", nullable: false), |
| 4 | 51 | | status = table.Column<string>(type: "text", nullable: false), |
| 4 | 52 | | created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
| 4 | 53 | | duration = table.Column<int>(type: "integer", nullable: false), |
| 4 | 54 | | processed_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: true), |
| 4 | 55 | | processor_id = table.Column<Guid>(type: "uuid", nullable: true), |
| 4 | 56 | | error = table.Column<string>(type: "text", nullable: true), |
| 4 | 57 | | event_id = table.Column<Guid>(type: "uuid", nullable: true), |
| 4 | 58 | | parent_id = table.Column<Guid>(type: "uuid", nullable: true), |
| 4 | 59 | | original_id = table.Column<Guid>(type: "uuid", nullable: true), |
| 4 | 60 | | batch_id = table.Column<Guid>(type: "uuid", nullable: true), |
| 4 | 61 | | not_before = table.Column<DateTime>(type: "timestamp with time zone", nullable: true) |
| 4 | 62 | | }, |
| 4 | 63 | | constraints: table => |
| 4 | 64 | | { |
| 4 | 65 | | table.PrimaryKey("pk_commands", x => x.id); |
| 8 | 66 | | }); |
| | 67 | |
|
| 4 | 68 | | migrationBuilder.CreateTable( |
| 4 | 69 | | name: "domain_events", |
| 4 | 70 | | schema: "syki", |
| 4 | 71 | | columns: table => new |
| 4 | 72 | | { |
| 4 | 73 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 74 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 75 | | entity_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 76 | | type = table.Column<string>(type: "text", nullable: false), |
| 4 | 77 | | data = table.Column<string>(type: "text", nullable: false), |
| 4 | 78 | | status = table.Column<string>(type: "text", nullable: false), |
| 4 | 79 | | occurred_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
| 4 | 80 | | processed_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: true), |
| 4 | 81 | | processor_id = table.Column<Guid>(type: "uuid", nullable: true), |
| 4 | 82 | | error = table.Column<string>(type: "text", nullable: true), |
| 4 | 83 | | duration = table.Column<int>(type: "integer", nullable: false) |
| 4 | 84 | | }, |
| 4 | 85 | | constraints: table => |
| 4 | 86 | | { |
| 4 | 87 | | table.PrimaryKey("pk_domain_events", x => x.id); |
| 8 | 88 | | }); |
| | 89 | |
|
| 4 | 90 | | migrationBuilder.CreateTable( |
| 4 | 91 | | name: "feature_flags", |
| 4 | 92 | | schema: "syki", |
| 4 | 93 | | columns: table => new |
| 4 | 94 | | { |
| 4 | 95 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 96 | | cross_login = table.Column<bool>(type: "boolean", nullable: false) |
| 4 | 97 | | }, |
| 4 | 98 | | constraints: table => |
| 4 | 99 | | { |
| 4 | 100 | | table.PrimaryKey("pk_feature_flags", x => x.id); |
| 8 | 101 | | }); |
| | 102 | |
|
| 4 | 103 | | migrationBuilder.CreateTable( |
| 4 | 104 | | name: "institutions", |
| 4 | 105 | | schema: "syki", |
| 4 | 106 | | columns: table => new |
| 4 | 107 | | { |
| 4 | 108 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 109 | | name = table.Column<string>(type: "text", nullable: false), |
| 4 | 110 | | created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false) |
| 4 | 111 | | }, |
| 4 | 112 | | constraints: table => |
| 4 | 113 | | { |
| 4 | 114 | | table.PrimaryKey("pk_institutions", x => x.id); |
| 8 | 115 | | }); |
| | 116 | |
|
| 4 | 117 | | migrationBuilder.CreateTable( |
| 4 | 118 | | name: "roles", |
| 4 | 119 | | schema: "syki", |
| 4 | 120 | | columns: table => new |
| 4 | 121 | | { |
| 4 | 122 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 123 | | name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true), |
| 4 | 124 | | normalized_name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: tru |
| 4 | 125 | | concurrency_stamp = table.Column<string>(type: "text", nullable: true) |
| 4 | 126 | | }, |
| 4 | 127 | | constraints: table => |
| 4 | 128 | | { |
| 4 | 129 | | table.PrimaryKey("pk_roles", x => x.id); |
| 8 | 130 | | }); |
| | 131 | |
|
| 4 | 132 | | migrationBuilder.CreateTable( |
| 4 | 133 | | name: "user_registers", |
| 4 | 134 | | schema: "syki", |
| 4 | 135 | | columns: table => new |
| 4 | 136 | | { |
| 4 | 137 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 138 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 139 | | email = table.Column<string>(type: "text", nullable: false), |
| 4 | 140 | | status = table.Column<string>(type: "text", nullable: false) |
| 4 | 141 | | }, |
| 4 | 142 | | constraints: table => |
| 4 | 143 | | { |
| 4 | 144 | | table.PrimaryKey("pk_user_registers", x => x.id); |
| 8 | 145 | | }); |
| | 146 | |
|
| 4 | 147 | | migrationBuilder.CreateTable( |
| 4 | 148 | | name: "academic_periods", |
| 4 | 149 | | schema: "syki", |
| 4 | 150 | | columns: table => new |
| 4 | 151 | | { |
| 4 | 152 | | id = table.Column<string>(type: "text", nullable: false), |
| 4 | 153 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 154 | | start_at = table.Column<DateOnly>(type: "date", nullable: false), |
| 4 | 155 | | end_at = table.Column<DateOnly>(type: "date", nullable: false) |
| 4 | 156 | | }, |
| 4 | 157 | | constraints: table => |
| 4 | 158 | | { |
| 4 | 159 | | table.PrimaryKey("pk_academic_periods", x => new { x.id, x.institution_id }); |
| 4 | 160 | | table.ForeignKey( |
| 4 | 161 | | name: "fk_academic_periods_institutions_institution_id", |
| 4 | 162 | | column: x => x.institution_id, |
| 4 | 163 | | principalSchema: "syki", |
| 4 | 164 | | principalTable: "institutions", |
| 4 | 165 | | principalColumn: "id", |
| 4 | 166 | | onDelete: ReferentialAction.Cascade); |
| 8 | 167 | | }); |
| | 168 | |
|
| 4 | 169 | | migrationBuilder.CreateTable( |
| 4 | 170 | | name: "campi", |
| 4 | 171 | | schema: "syki", |
| 4 | 172 | | columns: table => new |
| 4 | 173 | | { |
| 4 | 174 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 175 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 176 | | name = table.Column<string>(type: "text", nullable: false), |
| 4 | 177 | | state = table.Column<string>(type: "text", nullable: false), |
| 4 | 178 | | city = table.Column<string>(type: "text", nullable: false) |
| 4 | 179 | | }, |
| 4 | 180 | | constraints: table => |
| 4 | 181 | | { |
| 4 | 182 | | table.PrimaryKey("pk_campi", x => x.id); |
| 4 | 183 | | table.ForeignKey( |
| 4 | 184 | | name: "fk_campi_institutions_institution_id", |
| 4 | 185 | | column: x => x.institution_id, |
| 4 | 186 | | principalSchema: "syki", |
| 4 | 187 | | principalTable: "institutions", |
| 4 | 188 | | principalColumn: "id", |
| 4 | 189 | | onDelete: ReferentialAction.Cascade); |
| 8 | 190 | | }); |
| | 191 | |
|
| 4 | 192 | | migrationBuilder.CreateTable( |
| 4 | 193 | | name: "courses", |
| 4 | 194 | | schema: "syki", |
| 4 | 195 | | columns: table => new |
| 4 | 196 | | { |
| 4 | 197 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 198 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 199 | | name = table.Column<string>(type: "text", nullable: false), |
| 4 | 200 | | type = table.Column<string>(type: "text", nullable: false) |
| 4 | 201 | | }, |
| 4 | 202 | | constraints: table => |
| 4 | 203 | | { |
| 4 | 204 | | table.PrimaryKey("pk_courses", x => x.id); |
| 4 | 205 | | table.ForeignKey( |
| 4 | 206 | | name: "fk_courses_institutions_institution_id", |
| 4 | 207 | | column: x => x.institution_id, |
| 4 | 208 | | principalSchema: "syki", |
| 4 | 209 | | principalTable: "institutions", |
| 4 | 210 | | principalColumn: "id", |
| 4 | 211 | | onDelete: ReferentialAction.Cascade); |
| 8 | 212 | | }); |
| | 213 | |
|
| 4 | 214 | | migrationBuilder.CreateTable( |
| 4 | 215 | | name: "disciplines", |
| 4 | 216 | | schema: "syki", |
| 4 | 217 | | columns: table => new |
| 4 | 218 | | { |
| 4 | 219 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 220 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 221 | | name = table.Column<string>(type: "text", nullable: false), |
| 4 | 222 | | code = table.Column<string>(type: "text", nullable: false) |
| 4 | 223 | | }, |
| 4 | 224 | | constraints: table => |
| 4 | 225 | | { |
| 4 | 226 | | table.PrimaryKey("pk_disciplines", x => x.id); |
| 4 | 227 | | table.ForeignKey( |
| 4 | 228 | | name: "fk_disciplines_institutions_institution_id", |
| 4 | 229 | | column: x => x.institution_id, |
| 4 | 230 | | principalSchema: "syki", |
| 4 | 231 | | principalTable: "institutions", |
| 4 | 232 | | principalColumn: "id", |
| 4 | 233 | | onDelete: ReferentialAction.Cascade); |
| 8 | 234 | | }); |
| | 235 | |
|
| 4 | 236 | | migrationBuilder.CreateTable( |
| 4 | 237 | | name: "institution_configs", |
| 4 | 238 | | schema: "syki", |
| 4 | 239 | | columns: table => new |
| 4 | 240 | | { |
| 4 | 241 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 242 | | note_limit = table.Column<decimal>(type: "numeric", nullable: false), |
| 4 | 243 | | frequency_limit = table.Column<decimal>(type: "numeric(4,2)", precision: 4, scale: 2, nullable: fals |
| 4 | 244 | | }, |
| 4 | 245 | | constraints: table => |
| 4 | 246 | | { |
| 4 | 247 | | table.PrimaryKey("pk_institution_configs", x => x.institution_id); |
| 4 | 248 | | table.ForeignKey( |
| 4 | 249 | | name: "fk_institution_configs_institutions_institution_id", |
| 4 | 250 | | column: x => x.institution_id, |
| 4 | 251 | | principalSchema: "syki", |
| 4 | 252 | | principalTable: "institutions", |
| 4 | 253 | | principalColumn: "id", |
| 4 | 254 | | onDelete: ReferentialAction.Cascade); |
| 8 | 255 | | }); |
| | 256 | |
|
| 4 | 257 | | migrationBuilder.CreateTable( |
| 4 | 258 | | name: "notifications", |
| 4 | 259 | | schema: "syki", |
| 4 | 260 | | columns: table => new |
| 4 | 261 | | { |
| 4 | 262 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 263 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 264 | | title = table.Column<string>(type: "text", nullable: false), |
| 4 | 265 | | description = table.Column<string>(type: "text", nullable: false), |
| 4 | 266 | | timeless = table.Column<bool>(type: "boolean", nullable: false), |
| 4 | 267 | | target = table.Column<string>(type: "text", nullable: false), |
| 4 | 268 | | created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false) |
| 4 | 269 | | }, |
| 4 | 270 | | constraints: table => |
| 4 | 271 | | { |
| 4 | 272 | | table.PrimaryKey("pk_notifications", x => x.id); |
| 4 | 273 | | table.ForeignKey( |
| 4 | 274 | | name: "fk_notifications_institutions_institution_id", |
| 4 | 275 | | column: x => x.institution_id, |
| 4 | 276 | | principalSchema: "syki", |
| 4 | 277 | | principalTable: "institutions", |
| 4 | 278 | | principalColumn: "id", |
| 4 | 279 | | onDelete: ReferentialAction.Cascade); |
| 8 | 280 | | }); |
| | 281 | |
|
| 4 | 282 | | migrationBuilder.CreateTable( |
| 4 | 283 | | name: "users", |
| 4 | 284 | | schema: "syki", |
| 4 | 285 | | columns: table => new |
| 4 | 286 | | { |
| 4 | 287 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 288 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 289 | | name = table.Column<string>(type: "text", nullable: false), |
| 4 | 290 | | created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
| 4 | 291 | | user_name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true), |
| 4 | 292 | | normalized_user_name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable |
| 4 | 293 | | email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true), |
| 4 | 294 | | normalized_email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: tr |
| 4 | 295 | | email_confirmed = table.Column<bool>(type: "boolean", nullable: false), |
| 4 | 296 | | password_hash = table.Column<string>(type: "text", nullable: true), |
| 4 | 297 | | security_stamp = table.Column<string>(type: "text", nullable: true), |
| 4 | 298 | | concurrency_stamp = table.Column<string>(type: "text", nullable: true), |
| 4 | 299 | | phone_number = table.Column<string>(type: "text", nullable: true), |
| 4 | 300 | | phone_number_confirmed = table.Column<bool>(type: "boolean", nullable: false), |
| 4 | 301 | | two_factor_enabled = table.Column<bool>(type: "boolean", nullable: false), |
| 4 | 302 | | lockout_end = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true), |
| 4 | 303 | | lockout_enabled = table.Column<bool>(type: "boolean", nullable: false), |
| 4 | 304 | | access_failed_count = table.Column<int>(type: "integer", nullable: false) |
| 4 | 305 | | }, |
| 4 | 306 | | constraints: table => |
| 4 | 307 | | { |
| 4 | 308 | | table.PrimaryKey("pk_users", x => x.id); |
| 4 | 309 | | table.UniqueConstraint("ak_asp_net_users_institution_id_id", x => new { x.institution_id, x.id }); |
| 4 | 310 | | table.ForeignKey( |
| 4 | 311 | | name: "fk_users_institutions_institution_id", |
| 4 | 312 | | column: x => x.institution_id, |
| 4 | 313 | | principalSchema: "syki", |
| 4 | 314 | | principalTable: "institutions", |
| 4 | 315 | | principalColumn: "id", |
| 4 | 316 | | onDelete: ReferentialAction.Cascade); |
| 8 | 317 | | }); |
| | 318 | |
|
| 4 | 319 | | migrationBuilder.CreateTable( |
| 4 | 320 | | name: "webhook_subscriptions", |
| 4 | 321 | | schema: "syki", |
| 4 | 322 | | columns: table => new |
| 4 | 323 | | { |
| 4 | 324 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 325 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 326 | | name = table.Column<string>(type: "text", nullable: false), |
| 4 | 327 | | url = table.Column<string>(type: "text", nullable: false), |
| 4 | 328 | | created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
| 4 | 329 | | events = table.Column<string[]>(type: "text[]", nullable: false) |
| 4 | 330 | | }, |
| 4 | 331 | | constraints: table => |
| 4 | 332 | | { |
| 4 | 333 | | table.PrimaryKey("pk_webhook_subscriptions", x => x.id); |
| 4 | 334 | | table.ForeignKey( |
| 4 | 335 | | name: "fk_webhook_subscriptions_institutions_institution_id", |
| 4 | 336 | | column: x => x.institution_id, |
| 4 | 337 | | principalSchema: "syki", |
| 4 | 338 | | principalTable: "institutions", |
| 4 | 339 | | principalColumn: "id", |
| 4 | 340 | | onDelete: ReferentialAction.Cascade); |
| 8 | 341 | | }); |
| | 342 | |
|
| 4 | 343 | | migrationBuilder.CreateTable( |
| 4 | 344 | | name: "role_claims", |
| 4 | 345 | | schema: "syki", |
| 4 | 346 | | columns: table => new |
| 4 | 347 | | { |
| 4 | 348 | | id = table.Column<int>(type: "integer", nullable: false) |
| 4 | 349 | | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol |
| 4 | 350 | | role_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 351 | | claim_type = table.Column<string>(type: "text", nullable: true), |
| 4 | 352 | | claim_value = table.Column<string>(type: "text", nullable: true) |
| 4 | 353 | | }, |
| 4 | 354 | | constraints: table => |
| 4 | 355 | | { |
| 4 | 356 | | table.PrimaryKey("pk_role_claims", x => x.id); |
| 4 | 357 | | table.ForeignKey( |
| 4 | 358 | | name: "fk_role_claims_asp_net_roles_role_id", |
| 4 | 359 | | column: x => x.role_id, |
| 4 | 360 | | principalSchema: "syki", |
| 4 | 361 | | principalTable: "roles", |
| 4 | 362 | | principalColumn: "id", |
| 4 | 363 | | onDelete: ReferentialAction.Cascade); |
| 8 | 364 | | }); |
| | 365 | |
|
| 4 | 366 | | migrationBuilder.CreateTable( |
| 4 | 367 | | name: "enrollment_periods", |
| 4 | 368 | | schema: "syki", |
| 4 | 369 | | columns: table => new |
| 4 | 370 | | { |
| 4 | 371 | | id = table.Column<string>(type: "text", nullable: false), |
| 4 | 372 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 373 | | start_at = table.Column<DateOnly>(type: "date", nullable: false), |
| 4 | 374 | | end_at = table.Column<DateOnly>(type: "date", nullable: false) |
| 4 | 375 | | }, |
| 4 | 376 | | constraints: table => |
| 4 | 377 | | { |
| 4 | 378 | | table.PrimaryKey("pk_enrollment_periods", x => new { x.id, x.institution_id }); |
| 4 | 379 | | table.ForeignKey( |
| 4 | 380 | | name: "fk_enrollment_periods_academic_periods_id_institution_id", |
| 4 | 381 | | columns: x => new { x.id, x.institution_id }, |
| 4 | 382 | | principalSchema: "syki", |
| 4 | 383 | | principalTable: "academic_periods", |
| 4 | 384 | | principalColumns: new[] { "id", "institution_id" }, |
| 4 | 385 | | onDelete: ReferentialAction.Cascade); |
| 8 | 386 | | }); |
| | 387 | |
|
| 4 | 388 | | migrationBuilder.CreateTable( |
| 4 | 389 | | name: "course_curriculums", |
| 4 | 390 | | schema: "syki", |
| 4 | 391 | | columns: table => new |
| 4 | 392 | | { |
| 4 | 393 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 394 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 395 | | course_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 396 | | name = table.Column<string>(type: "text", nullable: false) |
| 4 | 397 | | }, |
| 4 | 398 | | constraints: table => |
| 4 | 399 | | { |
| 4 | 400 | | table.PrimaryKey("pk_course_curriculums", x => x.id); |
| 4 | 401 | | table.ForeignKey( |
| 4 | 402 | | name: "fk_course_curriculums_courses_course_id", |
| 4 | 403 | | column: x => x.course_id, |
| 4 | 404 | | principalSchema: "syki", |
| 4 | 405 | | principalTable: "courses", |
| 4 | 406 | | principalColumn: "id", |
| 4 | 407 | | onDelete: ReferentialAction.Cascade); |
| 4 | 408 | | table.ForeignKey( |
| 4 | 409 | | name: "fk_course_curriculums_institutions_institution_id", |
| 4 | 410 | | column: x => x.institution_id, |
| 4 | 411 | | principalSchema: "syki", |
| 4 | 412 | | principalTable: "institutions", |
| 4 | 413 | | principalColumn: "id", |
| 4 | 414 | | onDelete: ReferentialAction.Cascade); |
| 8 | 415 | | }); |
| | 416 | |
|
| 4 | 417 | | migrationBuilder.CreateTable( |
| 4 | 418 | | name: "courses__disciplines", |
| 4 | 419 | | schema: "syki", |
| 4 | 420 | | columns: table => new |
| 4 | 421 | | { |
| 4 | 422 | | course_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 423 | | discipline_id = table.Column<Guid>(type: "uuid", nullable: false) |
| 4 | 424 | | }, |
| 4 | 425 | | constraints: table => |
| 4 | 426 | | { |
| 4 | 427 | | table.PrimaryKey("pk_courses__disciplines", x => new { x.course_id, x.discipline_id }); |
| 4 | 428 | | table.ForeignKey( |
| 4 | 429 | | name: "fk_courses__disciplines_courses_course_id", |
| 4 | 430 | | column: x => x.course_id, |
| 4 | 431 | | principalSchema: "syki", |
| 4 | 432 | | principalTable: "courses", |
| 4 | 433 | | principalColumn: "id", |
| 4 | 434 | | onDelete: ReferentialAction.Cascade); |
| 4 | 435 | | table.ForeignKey( |
| 4 | 436 | | name: "fk_courses__disciplines_disciplines_discipline_id", |
| 4 | 437 | | column: x => x.discipline_id, |
| 4 | 438 | | principalSchema: "syki", |
| 4 | 439 | | principalTable: "disciplines", |
| 4 | 440 | | principalColumn: "id", |
| 4 | 441 | | onDelete: ReferentialAction.Cascade); |
| 8 | 442 | | }); |
| | 443 | |
|
| 4 | 444 | | migrationBuilder.CreateTable( |
| 4 | 445 | | name: "audit_logs", |
| 4 | 446 | | schema: "syki", |
| 4 | 447 | | columns: table => new |
| 4 | 448 | | { |
| 4 | 449 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 450 | | entity_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 451 | | entity_type = table.Column<string>(type: "text", nullable: false), |
| 4 | 452 | | action = table.Column<string>(type: "text", nullable: false), |
| 4 | 453 | | created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
| 4 | 454 | | user_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 455 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 456 | | data = table.Column<JsonDocument>(type: "jsonb", nullable: false) |
| 4 | 457 | | }, |
| 4 | 458 | | constraints: table => |
| 4 | 459 | | { |
| 4 | 460 | | table.PrimaryKey("pk_audit_logs", x => x.id); |
| 4 | 461 | | table.ForeignKey( |
| 4 | 462 | | name: "fk_audit_logs_asp_net_users_institution_id_user_id", |
| 4 | 463 | | columns: x => new { x.institution_id, x.user_id }, |
| 4 | 464 | | principalSchema: "syki", |
| 4 | 465 | | principalTable: "users", |
| 4 | 466 | | principalColumns: new[] { "institution_id", "id" }, |
| 4 | 467 | | onDelete: ReferentialAction.Cascade); |
| 8 | 468 | | }); |
| | 469 | |
|
| 4 | 470 | | migrationBuilder.CreateTable( |
| 4 | 471 | | name: "reset_password_tokens", |
| 4 | 472 | | schema: "syki", |
| 4 | 473 | | columns: table => new |
| 4 | 474 | | { |
| 4 | 475 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 476 | | user_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 477 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 478 | | token = table.Column<string>(type: "text", nullable: false), |
| 4 | 479 | | created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
| 4 | 480 | | used_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: true) |
| 4 | 481 | | }, |
| 4 | 482 | | constraints: table => |
| 4 | 483 | | { |
| 4 | 484 | | table.PrimaryKey("pk_reset_password_tokens", x => x.id); |
| 4 | 485 | | table.ForeignKey( |
| 4 | 486 | | name: "fk_reset_password_tokens_asp_net_users_user_id", |
| 4 | 487 | | column: x => x.user_id, |
| 4 | 488 | | principalSchema: "syki", |
| 4 | 489 | | principalTable: "users", |
| 4 | 490 | | principalColumn: "id", |
| 4 | 491 | | onDelete: ReferentialAction.Cascade); |
| 4 | 492 | | table.ForeignKey( |
| 4 | 493 | | name: "fk_reset_password_tokens_institutions_institution_id", |
| 4 | 494 | | column: x => x.institution_id, |
| 4 | 495 | | principalSchema: "syki", |
| 4 | 496 | | principalTable: "institutions", |
| 4 | 497 | | principalColumn: "id", |
| 4 | 498 | | onDelete: ReferentialAction.Cascade); |
| 8 | 499 | | }); |
| | 500 | |
|
| 4 | 501 | | migrationBuilder.CreateTable( |
| 4 | 502 | | name: "teachers", |
| 4 | 503 | | schema: "syki", |
| 4 | 504 | | columns: table => new |
| 4 | 505 | | { |
| 4 | 506 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 507 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 508 | | name = table.Column<string>(type: "text", nullable: false) |
| 4 | 509 | | }, |
| 4 | 510 | | constraints: table => |
| 4 | 511 | | { |
| 4 | 512 | | table.PrimaryKey("pk_teachers", x => x.id); |
| 4 | 513 | | table.ForeignKey( |
| 4 | 514 | | name: "fk_teachers_asp_net_users_institution_id_id", |
| 4 | 515 | | columns: x => new { x.institution_id, x.id }, |
| 4 | 516 | | principalSchema: "syki", |
| 4 | 517 | | principalTable: "users", |
| 4 | 518 | | principalColumns: new[] { "institution_id", "id" }, |
| 4 | 519 | | onDelete: ReferentialAction.Cascade); |
| 4 | 520 | | table.ForeignKey( |
| 4 | 521 | | name: "fk_teachers_institutions_institution_id", |
| 4 | 522 | | column: x => x.institution_id, |
| 4 | 523 | | principalSchema: "syki", |
| 4 | 524 | | principalTable: "institutions", |
| 4 | 525 | | principalColumn: "id", |
| 4 | 526 | | onDelete: ReferentialAction.Cascade); |
| 8 | 527 | | }); |
| | 528 | |
|
| 4 | 529 | | migrationBuilder.CreateTable( |
| 4 | 530 | | name: "user_claims", |
| 4 | 531 | | schema: "syki", |
| 4 | 532 | | columns: table => new |
| 4 | 533 | | { |
| 4 | 534 | | id = table.Column<int>(type: "integer", nullable: false) |
| 4 | 535 | | .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultCol |
| 4 | 536 | | user_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 537 | | claim_type = table.Column<string>(type: "text", nullable: true), |
| 4 | 538 | | claim_value = table.Column<string>(type: "text", nullable: true) |
| 4 | 539 | | }, |
| 4 | 540 | | constraints: table => |
| 4 | 541 | | { |
| 4 | 542 | | table.PrimaryKey("pk_user_claims", x => x.id); |
| 4 | 543 | | table.ForeignKey( |
| 4 | 544 | | name: "fk_user_claims_asp_net_users_user_id", |
| 4 | 545 | | column: x => x.user_id, |
| 4 | 546 | | principalSchema: "syki", |
| 4 | 547 | | principalTable: "users", |
| 4 | 548 | | principalColumn: "id", |
| 4 | 549 | | onDelete: ReferentialAction.Cascade); |
| 8 | 550 | | }); |
| | 551 | |
|
| 4 | 552 | | migrationBuilder.CreateTable( |
| 4 | 553 | | name: "user_logins", |
| 4 | 554 | | schema: "syki", |
| 4 | 555 | | columns: table => new |
| 4 | 556 | | { |
| 4 | 557 | | login_provider = table.Column<string>(type: "text", nullable: false), |
| 4 | 558 | | provider_key = table.Column<string>(type: "text", nullable: false), |
| 4 | 559 | | provider_display_name = table.Column<string>(type: "text", nullable: true), |
| 4 | 560 | | user_id = table.Column<Guid>(type: "uuid", nullable: false) |
| 4 | 561 | | }, |
| 4 | 562 | | constraints: table => |
| 4 | 563 | | { |
| 4 | 564 | | table.PrimaryKey("pk_user_logins", x => new { x.login_provider, x.provider_key }); |
| 4 | 565 | | table.ForeignKey( |
| 4 | 566 | | name: "fk_user_logins_asp_net_users_user_id", |
| 4 | 567 | | column: x => x.user_id, |
| 4 | 568 | | principalSchema: "syki", |
| 4 | 569 | | principalTable: "users", |
| 4 | 570 | | principalColumn: "id", |
| 4 | 571 | | onDelete: ReferentialAction.Cascade); |
| 8 | 572 | | }); |
| | 573 | |
|
| 4 | 574 | | migrationBuilder.CreateTable( |
| 4 | 575 | | name: "user_roles", |
| 4 | 576 | | schema: "syki", |
| 4 | 577 | | columns: table => new |
| 4 | 578 | | { |
| 4 | 579 | | user_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 580 | | role_id = table.Column<Guid>(type: "uuid", nullable: false) |
| 4 | 581 | | }, |
| 4 | 582 | | constraints: table => |
| 4 | 583 | | { |
| 4 | 584 | | table.PrimaryKey("pk_user_roles", x => new { x.user_id, x.role_id }); |
| 4 | 585 | | table.ForeignKey( |
| 4 | 586 | | name: "fk_user_roles_asp_net_roles_role_id", |
| 4 | 587 | | column: x => x.role_id, |
| 4 | 588 | | principalSchema: "syki", |
| 4 | 589 | | principalTable: "roles", |
| 4 | 590 | | principalColumn: "id", |
| 4 | 591 | | onDelete: ReferentialAction.Cascade); |
| 4 | 592 | | table.ForeignKey( |
| 4 | 593 | | name: "fk_user_roles_asp_net_users_user_id", |
| 4 | 594 | | column: x => x.user_id, |
| 4 | 595 | | principalSchema: "syki", |
| 4 | 596 | | principalTable: "users", |
| 4 | 597 | | principalColumn: "id", |
| 4 | 598 | | onDelete: ReferentialAction.Cascade); |
| 8 | 599 | | }); |
| | 600 | |
|
| 4 | 601 | | migrationBuilder.CreateTable( |
| 4 | 602 | | name: "user_tokens", |
| 4 | 603 | | schema: "syki", |
| 4 | 604 | | columns: table => new |
| 4 | 605 | | { |
| 4 | 606 | | user_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 607 | | login_provider = table.Column<string>(type: "text", nullable: false), |
| 4 | 608 | | name = table.Column<string>(type: "text", nullable: false), |
| 4 | 609 | | value = table.Column<string>(type: "text", nullable: true) |
| 4 | 610 | | }, |
| 4 | 611 | | constraints: table => |
| 4 | 612 | | { |
| 4 | 613 | | table.PrimaryKey("pk_user_tokens", x => new { x.user_id, x.login_provider, x.name }); |
| 4 | 614 | | table.ForeignKey( |
| 4 | 615 | | name: "fk_user_tokens_asp_net_users_user_id", |
| 4 | 616 | | column: x => x.user_id, |
| 4 | 617 | | principalSchema: "syki", |
| 4 | 618 | | principalTable: "users", |
| 4 | 619 | | principalColumn: "id", |
| 4 | 620 | | onDelete: ReferentialAction.Cascade); |
| 8 | 621 | | }); |
| | 622 | |
|
| 4 | 623 | | migrationBuilder.CreateTable( |
| 4 | 624 | | name: "users__notifications", |
| 4 | 625 | | schema: "syki", |
| 4 | 626 | | columns: table => new |
| 4 | 627 | | { |
| 4 | 628 | | user_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 629 | | notification_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 630 | | viewed_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: true) |
| 4 | 631 | | }, |
| 4 | 632 | | constraints: table => |
| 4 | 633 | | { |
| 4 | 634 | | table.PrimaryKey("pk_users__notifications", x => new { x.user_id, x.notification_id }); |
| 4 | 635 | | table.ForeignKey( |
| 4 | 636 | | name: "fk_users__notifications_asp_net_users_user_id", |
| 4 | 637 | | column: x => x.user_id, |
| 4 | 638 | | principalSchema: "syki", |
| 4 | 639 | | principalTable: "users", |
| 4 | 640 | | principalColumn: "id", |
| 4 | 641 | | onDelete: ReferentialAction.Cascade); |
| 4 | 642 | | table.ForeignKey( |
| 4 | 643 | | name: "fk_users__notifications_notifications_notification_id", |
| 4 | 644 | | column: x => x.notification_id, |
| 4 | 645 | | principalSchema: "syki", |
| 4 | 646 | | principalTable: "notifications", |
| 4 | 647 | | principalColumn: "id", |
| 4 | 648 | | onDelete: ReferentialAction.Cascade); |
| 8 | 649 | | }); |
| | 650 | |
|
| 4 | 651 | | migrationBuilder.CreateTable( |
| 4 | 652 | | name: "webhook_authentications", |
| 4 | 653 | | schema: "syki", |
| 4 | 654 | | columns: table => new |
| 4 | 655 | | { |
| 4 | 656 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 657 | | webhook_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 658 | | type = table.Column<string>(type: "text", nullable: false), |
| 4 | 659 | | api_key = table.Column<string>(type: "text", nullable: false) |
| 4 | 660 | | }, |
| 4 | 661 | | constraints: table => |
| 4 | 662 | | { |
| 4 | 663 | | table.PrimaryKey("pk_webhook_authentications", x => x.id); |
| 4 | 664 | | table.ForeignKey( |
| 4 | 665 | | name: "fk_webhook_authentications_webhook_subscriptions_webhook_id", |
| 4 | 666 | | column: x => x.webhook_id, |
| 4 | 667 | | principalSchema: "syki", |
| 4 | 668 | | principalTable: "webhook_subscriptions", |
| 4 | 669 | | principalColumn: "id"); |
| 8 | 670 | | }); |
| | 671 | |
|
| 4 | 672 | | migrationBuilder.CreateTable( |
| 4 | 673 | | name: "webhook_calls", |
| 4 | 674 | | schema: "syki", |
| 4 | 675 | | columns: table => new |
| 4 | 676 | | { |
| 4 | 677 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 678 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 679 | | webhook_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 680 | | payload = table.Column<string>(type: "text", nullable: false), |
| 4 | 681 | | @event = table.Column<string>(name: "event", type: "text", nullable: false), |
| 4 | 682 | | status = table.Column<string>(type: "text", nullable: false), |
| 4 | 683 | | attempts_count = table.Column<int>(type: "integer", nullable: false), |
| 4 | 684 | | created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false) |
| 4 | 685 | | }, |
| 4 | 686 | | constraints: table => |
| 4 | 687 | | { |
| 4 | 688 | | table.PrimaryKey("pk_webhook_calls", x => x.id); |
| 4 | 689 | | table.ForeignKey( |
| 4 | 690 | | name: "fk_webhook_calls_institutions_institution_id", |
| 4 | 691 | | column: x => x.institution_id, |
| 4 | 692 | | principalSchema: "syki", |
| 4 | 693 | | principalTable: "institutions", |
| 4 | 694 | | principalColumn: "id", |
| 4 | 695 | | onDelete: ReferentialAction.Cascade); |
| 4 | 696 | | table.ForeignKey( |
| 4 | 697 | | name: "fk_webhook_calls_webhook_subscriptions_webhook_id", |
| 4 | 698 | | column: x => x.webhook_id, |
| 4 | 699 | | principalSchema: "syki", |
| 4 | 700 | | principalTable: "webhook_subscriptions", |
| 4 | 701 | | principalColumn: "id", |
| 4 | 702 | | onDelete: ReferentialAction.Cascade); |
| 8 | 703 | | }); |
| | 704 | |
|
| 4 | 705 | | migrationBuilder.CreateTable( |
| 4 | 706 | | name: "course_curriculums__disciplines", |
| 4 | 707 | | schema: "syki", |
| 4 | 708 | | columns: table => new |
| 4 | 709 | | { |
| 4 | 710 | | course_curriculum_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 711 | | discipline_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 712 | | period = table.Column<byte>(type: "smallint", nullable: false), |
| 4 | 713 | | credits = table.Column<byte>(type: "smallint", nullable: false), |
| 4 | 714 | | workload = table.Column<int>(type: "integer", nullable: false) |
| 4 | 715 | | }, |
| 4 | 716 | | constraints: table => |
| 4 | 717 | | { |
| 4 | 718 | | table.PrimaryKey("pk_course_curriculums__disciplines", x => new { x.course_curriculum_id, x.discipli |
| 4 | 719 | | table.ForeignKey( |
| 4 | 720 | | name: "fk_course_curriculums__disciplines_course_curriculums_course_c", |
| 4 | 721 | | column: x => x.course_curriculum_id, |
| 4 | 722 | | principalSchema: "syki", |
| 4 | 723 | | principalTable: "course_curriculums", |
| 4 | 724 | | principalColumn: "id", |
| 4 | 725 | | onDelete: ReferentialAction.Cascade); |
| 4 | 726 | | table.ForeignKey( |
| 4 | 727 | | name: "fk_course_curriculums__disciplines_disciplines_discipline_id", |
| 4 | 728 | | column: x => x.discipline_id, |
| 4 | 729 | | principalSchema: "syki", |
| 4 | 730 | | principalTable: "disciplines", |
| 4 | 731 | | principalColumn: "id", |
| 4 | 732 | | onDelete: ReferentialAction.Cascade); |
| 8 | 733 | | }); |
| | 734 | |
|
| 4 | 735 | | migrationBuilder.CreateTable( |
| 4 | 736 | | name: "course_offerings", |
| 4 | 737 | | schema: "syki", |
| 4 | 738 | | columns: table => new |
| 4 | 739 | | { |
| 4 | 740 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 741 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 742 | | campus_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 743 | | course_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 744 | | course_curriculum_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 745 | | period = table.Column<string>(type: "text", nullable: false), |
| 4 | 746 | | shift = table.Column<string>(type: "text", nullable: false) |
| 4 | 747 | | }, |
| 4 | 748 | | constraints: table => |
| 4 | 749 | | { |
| 4 | 750 | | table.PrimaryKey("pk_course_offerings", x => x.id); |
| 4 | 751 | | table.ForeignKey( |
| 4 | 752 | | name: "fk_course_offerings_academic_periods_period_institution_id", |
| 4 | 753 | | columns: x => new { x.period, x.institution_id }, |
| 4 | 754 | | principalSchema: "syki", |
| 4 | 755 | | principalTable: "academic_periods", |
| 4 | 756 | | principalColumns: new[] { "id", "institution_id" }, |
| 4 | 757 | | onDelete: ReferentialAction.Cascade); |
| 4 | 758 | | table.ForeignKey( |
| 4 | 759 | | name: "fk_course_offerings_campi_campus_id", |
| 4 | 760 | | column: x => x.campus_id, |
| 4 | 761 | | principalSchema: "syki", |
| 4 | 762 | | principalTable: "campi", |
| 4 | 763 | | principalColumn: "id", |
| 4 | 764 | | onDelete: ReferentialAction.Cascade); |
| 4 | 765 | | table.ForeignKey( |
| 4 | 766 | | name: "fk_course_offerings_course_curriculums_course_curriculum_id", |
| 4 | 767 | | column: x => x.course_curriculum_id, |
| 4 | 768 | | principalSchema: "syki", |
| 4 | 769 | | principalTable: "course_curriculums", |
| 4 | 770 | | principalColumn: "id", |
| 4 | 771 | | onDelete: ReferentialAction.Cascade); |
| 4 | 772 | | table.ForeignKey( |
| 4 | 773 | | name: "fk_course_offerings_courses_course_id", |
| 4 | 774 | | column: x => x.course_id, |
| 4 | 775 | | principalSchema: "syki", |
| 4 | 776 | | principalTable: "courses", |
| 4 | 777 | | principalColumn: "id", |
| 4 | 778 | | onDelete: ReferentialAction.Cascade); |
| 4 | 779 | | table.ForeignKey( |
| 4 | 780 | | name: "fk_course_offerings_institutions_institution_id", |
| 4 | 781 | | column: x => x.institution_id, |
| 4 | 782 | | principalSchema: "syki", |
| 4 | 783 | | principalTable: "institutions", |
| 4 | 784 | | principalColumn: "id", |
| 4 | 785 | | onDelete: ReferentialAction.Cascade); |
| 8 | 786 | | }); |
| | 787 | |
|
| 4 | 788 | | migrationBuilder.CreateTable( |
| 4 | 789 | | name: "classes", |
| 4 | 790 | | schema: "syki", |
| 4 | 791 | | columns: table => new |
| 4 | 792 | | { |
| 4 | 793 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 794 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 795 | | discipline_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 796 | | teacher_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 797 | | period_id = table.Column<string>(type: "text", nullable: false), |
| 4 | 798 | | vacancies = table.Column<int>(type: "integer", nullable: false), |
| 4 | 799 | | status = table.Column<string>(type: "text", nullable: false), |
| 4 | 800 | | workload = table.Column<int>(type: "integer", nullable: false) |
| 4 | 801 | | }, |
| 4 | 802 | | constraints: table => |
| 4 | 803 | | { |
| 4 | 804 | | table.PrimaryKey("pk_classes", x => x.id); |
| 4 | 805 | | table.ForeignKey( |
| 4 | 806 | | name: "fk_classes_academic_periods_period_id_institution_id", |
| 4 | 807 | | columns: x => new { x.period_id, x.institution_id }, |
| 4 | 808 | | principalSchema: "syki", |
| 4 | 809 | | principalTable: "academic_periods", |
| 4 | 810 | | principalColumns: new[] { "id", "institution_id" }, |
| 4 | 811 | | onDelete: ReferentialAction.Cascade); |
| 4 | 812 | | table.ForeignKey( |
| 4 | 813 | | name: "fk_classes_disciplines_discipline_id", |
| 4 | 814 | | column: x => x.discipline_id, |
| 4 | 815 | | principalSchema: "syki", |
| 4 | 816 | | principalTable: "disciplines", |
| 4 | 817 | | principalColumn: "id", |
| 4 | 818 | | onDelete: ReferentialAction.Cascade); |
| 4 | 819 | | table.ForeignKey( |
| 4 | 820 | | name: "fk_classes_teachers_teacher_id", |
| 4 | 821 | | column: x => x.teacher_id, |
| 4 | 822 | | principalSchema: "syki", |
| 4 | 823 | | principalTable: "teachers", |
| 4 | 824 | | principalColumn: "id", |
| 4 | 825 | | onDelete: ReferentialAction.Cascade); |
| 8 | 826 | | }); |
| | 827 | |
|
| 4 | 828 | | migrationBuilder.CreateTable( |
| 4 | 829 | | name: "webhook_call_attempts", |
| 4 | 830 | | schema: "syki", |
| 4 | 831 | | columns: table => new |
| 4 | 832 | | { |
| 4 | 833 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 834 | | webhook_call_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 835 | | status = table.Column<string>(type: "text", nullable: false), |
| 4 | 836 | | status_code = table.Column<int>(type: "integer", nullable: false), |
| 4 | 837 | | response = table.Column<string>(type: "text", nullable: false), |
| 4 | 838 | | created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false) |
| 4 | 839 | | }, |
| 4 | 840 | | constraints: table => |
| 4 | 841 | | { |
| 4 | 842 | | table.PrimaryKey("pk_webhook_call_attempts", x => x.id); |
| 4 | 843 | | table.ForeignKey( |
| 4 | 844 | | name: "fk_webhook_call_attempts_webhook_calls_webhook_call_id", |
| 4 | 845 | | column: x => x.webhook_call_id, |
| 4 | 846 | | principalSchema: "syki", |
| 4 | 847 | | principalTable: "webhook_calls", |
| 4 | 848 | | principalColumn: "id", |
| 4 | 849 | | onDelete: ReferentialAction.Cascade); |
| 8 | 850 | | }); |
| | 851 | |
|
| 4 | 852 | | migrationBuilder.CreateTable( |
| 4 | 853 | | name: "students", |
| 4 | 854 | | schema: "syki", |
| 4 | 855 | | columns: table => new |
| 4 | 856 | | { |
| 4 | 857 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 858 | | institution_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 859 | | course_offering_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 860 | | name = table.Column<string>(type: "text", nullable: false), |
| 4 | 861 | | enrollment_code = table.Column<string>(type: "text", nullable: false), |
| 4 | 862 | | status = table.Column<string>(type: "text", nullable: false), |
| 4 | 863 | | yield_coefficient = table.Column<decimal>(type: "numeric(4,2)", precision: 4, scale: 2, nullable: fa |
| 4 | 864 | | }, |
| 4 | 865 | | constraints: table => |
| 4 | 866 | | { |
| 4 | 867 | | table.PrimaryKey("pk_students", x => x.id); |
| 4 | 868 | | table.ForeignKey( |
| 4 | 869 | | name: "fk_students_asp_net_users_institution_id_id", |
| 4 | 870 | | columns: x => new { x.institution_id, x.id }, |
| 4 | 871 | | principalSchema: "syki", |
| 4 | 872 | | principalTable: "users", |
| 4 | 873 | | principalColumns: new[] { "institution_id", "id" }, |
| 4 | 874 | | onDelete: ReferentialAction.Cascade); |
| 4 | 875 | | table.ForeignKey( |
| 4 | 876 | | name: "fk_students_course_offerings_course_offering_id", |
| 4 | 877 | | column: x => x.course_offering_id, |
| 4 | 878 | | principalSchema: "syki", |
| 4 | 879 | | principalTable: "course_offerings", |
| 4 | 880 | | principalColumn: "id", |
| 4 | 881 | | onDelete: ReferentialAction.Cascade); |
| 4 | 882 | | table.ForeignKey( |
| 4 | 883 | | name: "fk_students_institutions_institution_id", |
| 4 | 884 | | column: x => x.institution_id, |
| 4 | 885 | | principalSchema: "syki", |
| 4 | 886 | | principalTable: "institutions", |
| 4 | 887 | | principalColumn: "id", |
| 4 | 888 | | onDelete: ReferentialAction.Cascade); |
| 8 | 889 | | }); |
| | 890 | |
|
| 4 | 891 | | migrationBuilder.CreateTable( |
| 4 | 892 | | name: "class_activities", |
| 4 | 893 | | schema: "syki", |
| 4 | 894 | | columns: table => new |
| 4 | 895 | | { |
| 4 | 896 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 897 | | class_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 898 | | note = table.Column<string>(type: "text", nullable: false), |
| 4 | 899 | | title = table.Column<string>(type: "text", nullable: false), |
| 4 | 900 | | description = table.Column<string>(type: "text", nullable: false), |
| 4 | 901 | | type = table.Column<string>(type: "text", nullable: false), |
| 4 | 902 | | status = table.Column<string>(type: "text", nullable: false), |
| 4 | 903 | | weight = table.Column<int>(type: "integer", nullable: false), |
| 4 | 904 | | created_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
| 4 | 905 | | due_date = table.Column<DateOnly>(type: "date", nullable: false), |
| 4 | 906 | | due_hour = table.Column<string>(type: "text", nullable: false) |
| 4 | 907 | | }, |
| 4 | 908 | | constraints: table => |
| 4 | 909 | | { |
| 4 | 910 | | table.PrimaryKey("pk_class_activities", x => x.id); |
| 4 | 911 | | table.ForeignKey( |
| 4 | 912 | | name: "fk_class_activities_classes_class_id", |
| 4 | 913 | | column: x => x.class_id, |
| 4 | 914 | | principalSchema: "syki", |
| 4 | 915 | | principalTable: "classes", |
| 4 | 916 | | principalColumn: "id", |
| 4 | 917 | | onDelete: ReferentialAction.Cascade); |
| 8 | 918 | | }); |
| | 919 | |
|
| 4 | 920 | | migrationBuilder.CreateTable( |
| 4 | 921 | | name: "class_lessons", |
| 4 | 922 | | schema: "syki", |
| 4 | 923 | | columns: table => new |
| 4 | 924 | | { |
| 4 | 925 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 926 | | class_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 927 | | number = table.Column<int>(type: "integer", nullable: false), |
| 4 | 928 | | date = table.Column<DateOnly>(type: "date", nullable: false), |
| 4 | 929 | | start_at = table.Column<string>(type: "text", nullable: false), |
| 4 | 930 | | end_at = table.Column<string>(type: "text", nullable: false), |
| 4 | 931 | | status = table.Column<string>(type: "text", nullable: false) |
| 4 | 932 | | }, |
| 4 | 933 | | constraints: table => |
| 4 | 934 | | { |
| 4 | 935 | | table.PrimaryKey("pk_class_lessons", x => x.id); |
| 4 | 936 | | table.ForeignKey( |
| 4 | 937 | | name: "fk_class_lessons_classes_class_id", |
| 4 | 938 | | column: x => x.class_id, |
| 4 | 939 | | principalSchema: "syki", |
| 4 | 940 | | principalTable: "classes", |
| 4 | 941 | | principalColumn: "id", |
| 4 | 942 | | onDelete: ReferentialAction.Cascade); |
| 8 | 943 | | }); |
| | 944 | |
|
| 4 | 945 | | migrationBuilder.CreateTable( |
| 4 | 946 | | name: "schedules", |
| 4 | 947 | | schema: "syki", |
| 4 | 948 | | columns: table => new |
| 4 | 949 | | { |
| 4 | 950 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 951 | | class_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 952 | | day = table.Column<string>(type: "text", nullable: false), |
| 4 | 953 | | start_at = table.Column<string>(type: "text", nullable: false), |
| 4 | 954 | | end_at = table.Column<string>(type: "text", nullable: false) |
| 4 | 955 | | }, |
| 4 | 956 | | constraints: table => |
| 4 | 957 | | { |
| 4 | 958 | | table.PrimaryKey("pk_schedules", x => x.id); |
| 4 | 959 | | table.ForeignKey( |
| 4 | 960 | | name: "fk_schedules_classes_class_id", |
| 4 | 961 | | column: x => x.class_id, |
| 4 | 962 | | principalSchema: "syki", |
| 4 | 963 | | principalTable: "classes", |
| 4 | 964 | | principalColumn: "id", |
| 4 | 965 | | onDelete: ReferentialAction.Cascade); |
| 8 | 966 | | }); |
| | 967 | |
|
| 4 | 968 | | migrationBuilder.CreateTable( |
| 4 | 969 | | name: "classes__students", |
| 4 | 970 | | schema: "syki", |
| 4 | 971 | | columns: table => new |
| 4 | 972 | | { |
| 4 | 973 | | class_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 974 | | syki_student_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 975 | | student_discipline_status = table.Column<string>(type: "text", nullable: false) |
| 4 | 976 | | }, |
| 4 | 977 | | constraints: table => |
| 4 | 978 | | { |
| 4 | 979 | | table.PrimaryKey("pk_classes__students", x => new { x.class_id, x.syki_student_id }); |
| 4 | 980 | | table.ForeignKey( |
| 4 | 981 | | name: "fk_classes__students_classes_class_id", |
| 4 | 982 | | column: x => x.class_id, |
| 4 | 983 | | principalSchema: "syki", |
| 4 | 984 | | principalTable: "classes", |
| 4 | 985 | | principalColumn: "id", |
| 4 | 986 | | onDelete: ReferentialAction.Cascade); |
| 4 | 987 | | table.ForeignKey( |
| 4 | 988 | | name: "fk_classes__students_students_syki_student_id", |
| 4 | 989 | | column: x => x.syki_student_id, |
| 4 | 990 | | principalSchema: "syki", |
| 4 | 991 | | principalTable: "students", |
| 4 | 992 | | principalColumn: "id", |
| 4 | 993 | | onDelete: ReferentialAction.Cascade); |
| 8 | 994 | | }); |
| | 995 | |
|
| 4 | 996 | | migrationBuilder.CreateTable( |
| 4 | 997 | | name: "student_class_notes", |
| 4 | 998 | | schema: "syki", |
| 4 | 999 | | columns: table => new |
| 4 | 1000 | | { |
| 4 | 1001 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 1002 | | class_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 1003 | | student_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 1004 | | type = table.Column<string>(type: "text", nullable: false), |
| 4 | 1005 | | note = table.Column<decimal>(type: "numeric(4,2)", precision: 4, scale: 2, nullable: false) |
| 4 | 1006 | | }, |
| 4 | 1007 | | constraints: table => |
| 4 | 1008 | | { |
| 4 | 1009 | | table.PrimaryKey("pk_student_class_notes", x => x.id); |
| 4 | 1010 | | table.ForeignKey( |
| 4 | 1011 | | name: "fk_student_class_notes_classes_class_id", |
| 4 | 1012 | | column: x => x.class_id, |
| 4 | 1013 | | principalSchema: "syki", |
| 4 | 1014 | | principalTable: "classes", |
| 4 | 1015 | | principalColumn: "id", |
| 4 | 1016 | | onDelete: ReferentialAction.Cascade); |
| 4 | 1017 | | table.ForeignKey( |
| 4 | 1018 | | name: "fk_student_class_notes_students_student_id", |
| 4 | 1019 | | column: x => x.student_id, |
| 4 | 1020 | | principalSchema: "syki", |
| 4 | 1021 | | principalTable: "students", |
| 4 | 1022 | | principalColumn: "id", |
| 4 | 1023 | | onDelete: ReferentialAction.Cascade); |
| 8 | 1024 | | }); |
| | 1025 | |
|
| 4 | 1026 | | migrationBuilder.CreateTable( |
| 4 | 1027 | | name: "class_activity_works", |
| 4 | 1028 | | schema: "syki", |
| 4 | 1029 | | columns: table => new |
| 4 | 1030 | | { |
| 4 | 1031 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 1032 | | class_activity_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 1033 | | syki_student_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 1034 | | link = table.Column<string>(type: "text", nullable: true), |
| 4 | 1035 | | note = table.Column<decimal>(type: "numeric", nullable: false), |
| 4 | 1036 | | status = table.Column<string>(type: "text", nullable: false) |
| 4 | 1037 | | }, |
| 4 | 1038 | | constraints: table => |
| 4 | 1039 | | { |
| 4 | 1040 | | table.PrimaryKey("pk_class_activity_works", x => x.id); |
| 4 | 1041 | | table.ForeignKey( |
| 4 | 1042 | | name: "fk_class_activity_works_class_activities_class_activity_id", |
| 4 | 1043 | | column: x => x.class_activity_id, |
| 4 | 1044 | | principalSchema: "syki", |
| 4 | 1045 | | principalTable: "class_activities", |
| 4 | 1046 | | principalColumn: "id", |
| 4 | 1047 | | onDelete: ReferentialAction.Cascade); |
| 4 | 1048 | | table.ForeignKey( |
| 4 | 1049 | | name: "fk_class_activity_works_students_syki_student_id", |
| 4 | 1050 | | column: x => x.syki_student_id, |
| 4 | 1051 | | principalSchema: "syki", |
| 4 | 1052 | | principalTable: "students", |
| 4 | 1053 | | principalColumn: "id", |
| 4 | 1054 | | onDelete: ReferentialAction.Cascade); |
| 8 | 1055 | | }); |
| | 1056 | |
|
| 4 | 1057 | | migrationBuilder.CreateTable( |
| 4 | 1058 | | name: "class_lesson_attendances", |
| 4 | 1059 | | schema: "syki", |
| 4 | 1060 | | columns: table => new |
| 4 | 1061 | | { |
| 4 | 1062 | | id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 1063 | | class_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 1064 | | lesson_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 1065 | | student_id = table.Column<Guid>(type: "uuid", nullable: false), |
| 4 | 1066 | | present = table.Column<bool>(type: "boolean", nullable: false) |
| 4 | 1067 | | }, |
| 4 | 1068 | | constraints: table => |
| 4 | 1069 | | { |
| 4 | 1070 | | table.PrimaryKey("pk_class_lesson_attendances", x => x.id); |
| 4 | 1071 | | table.ForeignKey( |
| 4 | 1072 | | name: "fk_class_lesson_attendances_class_lessons_lesson_id", |
| 4 | 1073 | | column: x => x.lesson_id, |
| 4 | 1074 | | principalSchema: "syki", |
| 4 | 1075 | | principalTable: "class_lessons", |
| 4 | 1076 | | principalColumn: "id", |
| 4 | 1077 | | onDelete: ReferentialAction.Cascade); |
| 4 | 1078 | | table.ForeignKey( |
| 4 | 1079 | | name: "fk_class_lesson_attendances_classes_class_id", |
| 4 | 1080 | | column: x => x.class_id, |
| 4 | 1081 | | principalSchema: "syki", |
| 4 | 1082 | | principalTable: "classes", |
| 4 | 1083 | | principalColumn: "id", |
| 4 | 1084 | | onDelete: ReferentialAction.Cascade); |
| 4 | 1085 | | table.ForeignKey( |
| 4 | 1086 | | name: "fk_class_lesson_attendances_students_student_id", |
| 4 | 1087 | | column: x => x.student_id, |
| 4 | 1088 | | principalSchema: "syki", |
| 4 | 1089 | | principalTable: "students", |
| 4 | 1090 | | principalColumn: "id", |
| 4 | 1091 | | onDelete: ReferentialAction.Cascade); |
| 8 | 1092 | | }); |
| | 1093 | |
|
| 4 | 1094 | | migrationBuilder.InsertData( |
| 4 | 1095 | | schema: "syki", |
| 4 | 1096 | | table: "roles", |
| 4 | 1097 | | columns: new[] { "id", "concurrency_stamp", "name", "normalized_name" }, |
| 4 | 1098 | | values: new object[,] |
| 4 | 1099 | | { |
| 4 | 1100 | | { new Guid("5912ebe1-9e6a-4ce1-90bf-8490534fb4e1"), "5912ebe1-9e6a-4ce1-90bf-8490534fb4e1", "Adm", " |
| 4 | 1101 | | { new Guid("78691a7a-f554-42d7-a5cf-8d474b6de0dd"), "78691a7a-f554-42d7-a5cf-8d474b6de0dd", "Academi |
| 4 | 1102 | | { new Guid("ca6f394f-6fd9-48cc-90a8-b379636a24e7"), "ca6f394f-6fd9-48cc-90a8-b379636a24e7", "Teacher |
| 4 | 1103 | | { new Guid("f9ad5139-06c3-4ce2-9748-ecc498b087c7"), "f9ad5139-06c3-4ce2-9748-ecc498b087c7", "Student |
| 4 | 1104 | | }); |
| | 1105 | |
|
| 4 | 1106 | | migrationBuilder.CreateIndex( |
| 4 | 1107 | | name: "ix_academic_periods_institution_id", |
| 4 | 1108 | | schema: "syki", |
| 4 | 1109 | | table: "academic_periods", |
| 4 | 1110 | | column: "institution_id"); |
| | 1111 | |
|
| 4 | 1112 | | migrationBuilder.CreateIndex( |
| 4 | 1113 | | name: "ix_audit_logs_institution_id_user_id", |
| 4 | 1114 | | schema: "syki", |
| 4 | 1115 | | table: "audit_logs", |
| 4 | 1116 | | columns: new[] { "institution_id", "user_id" }); |
| | 1117 | |
|
| 4 | 1118 | | migrationBuilder.CreateIndex( |
| 4 | 1119 | | name: "ix_campi_institution_id", |
| 4 | 1120 | | schema: "syki", |
| 4 | 1121 | | table: "campi", |
| 4 | 1122 | | column: "institution_id"); |
| | 1123 | |
|
| 4 | 1124 | | migrationBuilder.CreateIndex( |
| 4 | 1125 | | name: "ix_class_activities_class_id", |
| 4 | 1126 | | schema: "syki", |
| 4 | 1127 | | table: "class_activities", |
| 4 | 1128 | | column: "class_id"); |
| | 1129 | |
|
| 4 | 1130 | | migrationBuilder.CreateIndex( |
| 4 | 1131 | | name: "ix_class_activity_works_class_activity_id", |
| 4 | 1132 | | schema: "syki", |
| 4 | 1133 | | table: "class_activity_works", |
| 4 | 1134 | | column: "class_activity_id"); |
| | 1135 | |
|
| 4 | 1136 | | migrationBuilder.CreateIndex( |
| 4 | 1137 | | name: "ix_class_activity_works_syki_student_id", |
| 4 | 1138 | | schema: "syki", |
| 4 | 1139 | | table: "class_activity_works", |
| 4 | 1140 | | column: "syki_student_id"); |
| | 1141 | |
|
| 4 | 1142 | | migrationBuilder.CreateIndex( |
| 4 | 1143 | | name: "ix_class_lesson_attendances_class_id", |
| 4 | 1144 | | schema: "syki", |
| 4 | 1145 | | table: "class_lesson_attendances", |
| 4 | 1146 | | column: "class_id"); |
| | 1147 | |
|
| 4 | 1148 | | migrationBuilder.CreateIndex( |
| 4 | 1149 | | name: "ix_class_lesson_attendances_lesson_id_student_id", |
| 4 | 1150 | | schema: "syki", |
| 4 | 1151 | | table: "class_lesson_attendances", |
| 4 | 1152 | | columns: new[] { "lesson_id", "student_id" }, |
| 4 | 1153 | | unique: true); |
| | 1154 | |
|
| 4 | 1155 | | migrationBuilder.CreateIndex( |
| 4 | 1156 | | name: "ix_class_lesson_attendances_student_id", |
| 4 | 1157 | | schema: "syki", |
| 4 | 1158 | | table: "class_lesson_attendances", |
| 4 | 1159 | | column: "student_id"); |
| | 1160 | |
|
| 4 | 1161 | | migrationBuilder.CreateIndex( |
| 4 | 1162 | | name: "ix_class_lessons_class_id", |
| 4 | 1163 | | schema: "syki", |
| 4 | 1164 | | table: "class_lessons", |
| 4 | 1165 | | column: "class_id"); |
| | 1166 | |
|
| 4 | 1167 | | migrationBuilder.CreateIndex( |
| 4 | 1168 | | name: "ix_classes_discipline_id", |
| 4 | 1169 | | schema: "syki", |
| 4 | 1170 | | table: "classes", |
| 4 | 1171 | | column: "discipline_id"); |
| | 1172 | |
|
| 4 | 1173 | | migrationBuilder.CreateIndex( |
| 4 | 1174 | | name: "ix_classes_period_id_institution_id", |
| 4 | 1175 | | schema: "syki", |
| 4 | 1176 | | table: "classes", |
| 4 | 1177 | | columns: new[] { "period_id", "institution_id" }); |
| | 1178 | |
|
| 4 | 1179 | | migrationBuilder.CreateIndex( |
| 4 | 1180 | | name: "ix_classes_teacher_id", |
| 4 | 1181 | | schema: "syki", |
| 4 | 1182 | | table: "classes", |
| 4 | 1183 | | column: "teacher_id"); |
| | 1184 | |
|
| 4 | 1185 | | migrationBuilder.CreateIndex( |
| 4 | 1186 | | name: "ix_classes__students_syki_student_id", |
| 4 | 1187 | | schema: "syki", |
| 4 | 1188 | | table: "classes__students", |
| 4 | 1189 | | column: "syki_student_id"); |
| | 1190 | |
|
| 4 | 1191 | | migrationBuilder.CreateIndex( |
| 4 | 1192 | | name: "ix_course_curriculums_course_id", |
| 4 | 1193 | | schema: "syki", |
| 4 | 1194 | | table: "course_curriculums", |
| 4 | 1195 | | column: "course_id"); |
| | 1196 | |
|
| 4 | 1197 | | migrationBuilder.CreateIndex( |
| 4 | 1198 | | name: "ix_course_curriculums_institution_id", |
| 4 | 1199 | | schema: "syki", |
| 4 | 1200 | | table: "course_curriculums", |
| 4 | 1201 | | column: "institution_id"); |
| | 1202 | |
|
| 4 | 1203 | | migrationBuilder.CreateIndex( |
| 4 | 1204 | | name: "ix_course_curriculums__disciplines_discipline_id", |
| 4 | 1205 | | schema: "syki", |
| 4 | 1206 | | table: "course_curriculums__disciplines", |
| 4 | 1207 | | column: "discipline_id"); |
| | 1208 | |
|
| 4 | 1209 | | migrationBuilder.CreateIndex( |
| 4 | 1210 | | name: "ix_course_offerings_campus_id", |
| 4 | 1211 | | schema: "syki", |
| 4 | 1212 | | table: "course_offerings", |
| 4 | 1213 | | column: "campus_id"); |
| | 1214 | |
|
| 4 | 1215 | | migrationBuilder.CreateIndex( |
| 4 | 1216 | | name: "ix_course_offerings_course_curriculum_id", |
| 4 | 1217 | | schema: "syki", |
| 4 | 1218 | | table: "course_offerings", |
| 4 | 1219 | | column: "course_curriculum_id"); |
| | 1220 | |
|
| 4 | 1221 | | migrationBuilder.CreateIndex( |
| 4 | 1222 | | name: "ix_course_offerings_course_id", |
| 4 | 1223 | | schema: "syki", |
| 4 | 1224 | | table: "course_offerings", |
| 4 | 1225 | | column: "course_id"); |
| | 1226 | |
|
| 4 | 1227 | | migrationBuilder.CreateIndex( |
| 4 | 1228 | | name: "ix_course_offerings_institution_id", |
| 4 | 1229 | | schema: "syki", |
| 4 | 1230 | | table: "course_offerings", |
| 4 | 1231 | | column: "institution_id"); |
| | 1232 | |
|
| 4 | 1233 | | migrationBuilder.CreateIndex( |
| 4 | 1234 | | name: "ix_course_offerings_period_institution_id", |
| 4 | 1235 | | schema: "syki", |
| 4 | 1236 | | table: "course_offerings", |
| 4 | 1237 | | columns: new[] { "period", "institution_id" }); |
| | 1238 | |
|
| 4 | 1239 | | migrationBuilder.CreateIndex( |
| 4 | 1240 | | name: "ix_courses_institution_id", |
| 4 | 1241 | | schema: "syki", |
| 4 | 1242 | | table: "courses", |
| 4 | 1243 | | column: "institution_id"); |
| | 1244 | |
|
| 4 | 1245 | | migrationBuilder.CreateIndex( |
| 4 | 1246 | | name: "ix_courses__disciplines_discipline_id", |
| 4 | 1247 | | schema: "syki", |
| 4 | 1248 | | table: "courses__disciplines", |
| 4 | 1249 | | column: "discipline_id"); |
| | 1250 | |
|
| 4 | 1251 | | migrationBuilder.CreateIndex( |
| 4 | 1252 | | name: "ix_disciplines_institution_id", |
| 4 | 1253 | | schema: "syki", |
| 4 | 1254 | | table: "disciplines", |
| 4 | 1255 | | column: "institution_id"); |
| | 1256 | |
|
| 4 | 1257 | | migrationBuilder.CreateIndex( |
| 4 | 1258 | | name: "ix_notifications_institution_id", |
| 4 | 1259 | | schema: "syki", |
| 4 | 1260 | | table: "notifications", |
| 4 | 1261 | | column: "institution_id"); |
| | 1262 | |
|
| 4 | 1263 | | migrationBuilder.CreateIndex( |
| 4 | 1264 | | name: "ix_reset_password_tokens_institution_id", |
| 4 | 1265 | | schema: "syki", |
| 4 | 1266 | | table: "reset_password_tokens", |
| 4 | 1267 | | column: "institution_id"); |
| | 1268 | |
|
| 4 | 1269 | | migrationBuilder.CreateIndex( |
| 4 | 1270 | | name: "ix_reset_password_tokens_token", |
| 4 | 1271 | | schema: "syki", |
| 4 | 1272 | | table: "reset_password_tokens", |
| 4 | 1273 | | column: "token", |
| 4 | 1274 | | unique: true); |
| | 1275 | |
|
| 4 | 1276 | | migrationBuilder.CreateIndex( |
| 4 | 1277 | | name: "ix_reset_password_tokens_user_id", |
| 4 | 1278 | | schema: "syki", |
| 4 | 1279 | | table: "reset_password_tokens", |
| 4 | 1280 | | column: "user_id"); |
| | 1281 | |
|
| 4 | 1282 | | migrationBuilder.CreateIndex( |
| 4 | 1283 | | name: "ix_role_claims_role_id", |
| 4 | 1284 | | schema: "syki", |
| 4 | 1285 | | table: "role_claims", |
| 4 | 1286 | | column: "role_id"); |
| | 1287 | |
|
| 4 | 1288 | | migrationBuilder.CreateIndex( |
| 4 | 1289 | | name: "role_name_index", |
| 4 | 1290 | | schema: "syki", |
| 4 | 1291 | | table: "roles", |
| 4 | 1292 | | column: "normalized_name", |
| 4 | 1293 | | unique: true); |
| | 1294 | |
|
| 4 | 1295 | | migrationBuilder.CreateIndex( |
| 4 | 1296 | | name: "ix_schedules_class_id", |
| 4 | 1297 | | schema: "syki", |
| 4 | 1298 | | table: "schedules", |
| 4 | 1299 | | column: "class_id"); |
| | 1300 | |
|
| 4 | 1301 | | migrationBuilder.CreateIndex( |
| 4 | 1302 | | name: "ix_student_class_notes_class_id_student_id_type", |
| 4 | 1303 | | schema: "syki", |
| 4 | 1304 | | table: "student_class_notes", |
| 4 | 1305 | | columns: new[] { "class_id", "student_id", "type" }, |
| 4 | 1306 | | unique: true); |
| | 1307 | |
|
| 4 | 1308 | | migrationBuilder.CreateIndex( |
| 4 | 1309 | | name: "ix_student_class_notes_student_id", |
| 4 | 1310 | | schema: "syki", |
| 4 | 1311 | | table: "student_class_notes", |
| 4 | 1312 | | column: "student_id"); |
| | 1313 | |
|
| 4 | 1314 | | migrationBuilder.CreateIndex( |
| 4 | 1315 | | name: "ix_students_course_offering_id", |
| 4 | 1316 | | schema: "syki", |
| 4 | 1317 | | table: "students", |
| 4 | 1318 | | column: "course_offering_id"); |
| | 1319 | |
|
| 4 | 1320 | | migrationBuilder.CreateIndex( |
| 4 | 1321 | | name: "ix_students_enrollment_code", |
| 4 | 1322 | | schema: "syki", |
| 4 | 1323 | | table: "students", |
| 4 | 1324 | | column: "enrollment_code", |
| 4 | 1325 | | unique: true); |
| | 1326 | |
|
| 4 | 1327 | | migrationBuilder.CreateIndex( |
| 4 | 1328 | | name: "ix_students_institution_id_id", |
| 4 | 1329 | | schema: "syki", |
| 4 | 1330 | | table: "students", |
| 4 | 1331 | | columns: new[] { "institution_id", "id" }, |
| 4 | 1332 | | unique: true); |
| | 1333 | |
|
| 4 | 1334 | | migrationBuilder.CreateIndex( |
| 4 | 1335 | | name: "ix_teachers_institution_id_id", |
| 4 | 1336 | | schema: "syki", |
| 4 | 1337 | | table: "teachers", |
| 4 | 1338 | | columns: new[] { "institution_id", "id" }, |
| 4 | 1339 | | unique: true); |
| | 1340 | |
|
| 4 | 1341 | | migrationBuilder.CreateIndex( |
| 4 | 1342 | | name: "ix_user_claims_user_id", |
| 4 | 1343 | | schema: "syki", |
| 4 | 1344 | | table: "user_claims", |
| 4 | 1345 | | column: "user_id"); |
| | 1346 | |
|
| 4 | 1347 | | migrationBuilder.CreateIndex( |
| 4 | 1348 | | name: "ix_user_logins_user_id", |
| 4 | 1349 | | schema: "syki", |
| 4 | 1350 | | table: "user_logins", |
| 4 | 1351 | | column: "user_id"); |
| | 1352 | |
|
| 4 | 1353 | | migrationBuilder.CreateIndex( |
| 4 | 1354 | | name: "ix_user_registers_email", |
| 4 | 1355 | | schema: "syki", |
| 4 | 1356 | | table: "user_registers", |
| 4 | 1357 | | column: "email", |
| 4 | 1358 | | unique: true); |
| | 1359 | |
|
| 4 | 1360 | | migrationBuilder.CreateIndex( |
| 4 | 1361 | | name: "ix_user_roles_role_id", |
| 4 | 1362 | | schema: "syki", |
| 4 | 1363 | | table: "user_roles", |
| 4 | 1364 | | column: "role_id"); |
| | 1365 | |
|
| 4 | 1366 | | migrationBuilder.CreateIndex( |
| 4 | 1367 | | name: "email_index", |
| 4 | 1368 | | schema: "syki", |
| 4 | 1369 | | table: "users", |
| 4 | 1370 | | column: "normalized_email"); |
| | 1371 | |
|
| 4 | 1372 | | migrationBuilder.CreateIndex( |
| 4 | 1373 | | name: "user_name_index", |
| 4 | 1374 | | schema: "syki", |
| 4 | 1375 | | table: "users", |
| 4 | 1376 | | column: "normalized_user_name", |
| 4 | 1377 | | unique: true); |
| | 1378 | |
|
| 4 | 1379 | | migrationBuilder.CreateIndex( |
| 4 | 1380 | | name: "ix_users__notifications_notification_id", |
| 4 | 1381 | | schema: "syki", |
| 4 | 1382 | | table: "users__notifications", |
| 4 | 1383 | | column: "notification_id"); |
| | 1384 | |
|
| 4 | 1385 | | migrationBuilder.CreateIndex( |
| 4 | 1386 | | name: "ix_webhook_authentications_webhook_id", |
| 4 | 1387 | | schema: "syki", |
| 4 | 1388 | | table: "webhook_authentications", |
| 4 | 1389 | | column: "webhook_id", |
| 4 | 1390 | | unique: true); |
| | 1391 | |
|
| 4 | 1392 | | migrationBuilder.CreateIndex( |
| 4 | 1393 | | name: "ix_webhook_call_attempts_webhook_call_id", |
| 4 | 1394 | | schema: "syki", |
| 4 | 1395 | | table: "webhook_call_attempts", |
| 4 | 1396 | | column: "webhook_call_id"); |
| | 1397 | |
|
| 4 | 1398 | | migrationBuilder.CreateIndex( |
| 4 | 1399 | | name: "ix_webhook_calls_institution_id", |
| 4 | 1400 | | schema: "syki", |
| 4 | 1401 | | table: "webhook_calls", |
| 4 | 1402 | | column: "institution_id"); |
| | 1403 | |
|
| 4 | 1404 | | migrationBuilder.CreateIndex( |
| 4 | 1405 | | name: "ix_webhook_calls_webhook_id", |
| 4 | 1406 | | schema: "syki", |
| 4 | 1407 | | table: "webhook_calls", |
| 4 | 1408 | | column: "webhook_id"); |
| | 1409 | |
|
| 4 | 1410 | | migrationBuilder.CreateIndex( |
| 4 | 1411 | | name: "ix_webhook_subscriptions_institution_id", |
| 4 | 1412 | | schema: "syki", |
| 4 | 1413 | | table: "webhook_subscriptions", |
| 4 | 1414 | | column: "institution_id"); |
| 4 | 1415 | | } |
| | 1416 | |
|
| | 1417 | | /// <inheritdoc /> |
| | 1418 | | protected override void Down(MigrationBuilder migrationBuilder) |
| | 1419 | | { |
| 0 | 1420 | | migrationBuilder.DropTable( |
| 0 | 1421 | | name: "audit_logs", |
| 0 | 1422 | | schema: "syki"); |
| | 1423 | |
|
| 0 | 1424 | | migrationBuilder.DropTable( |
| 0 | 1425 | | name: "class_activity_works", |
| 0 | 1426 | | schema: "syki"); |
| | 1427 | |
|
| 0 | 1428 | | migrationBuilder.DropTable( |
| 0 | 1429 | | name: "class_lesson_attendances", |
| 0 | 1430 | | schema: "syki"); |
| | 1431 | |
|
| 0 | 1432 | | migrationBuilder.DropTable( |
| 0 | 1433 | | name: "classes__students", |
| 0 | 1434 | | schema: "syki"); |
| | 1435 | |
|
| 0 | 1436 | | migrationBuilder.DropTable( |
| 0 | 1437 | | name: "command_batches", |
| 0 | 1438 | | schema: "syki"); |
| | 1439 | |
|
| 0 | 1440 | | migrationBuilder.DropTable( |
| 0 | 1441 | | name: "commands", |
| 0 | 1442 | | schema: "syki"); |
| | 1443 | |
|
| 0 | 1444 | | migrationBuilder.DropTable( |
| 0 | 1445 | | name: "course_curriculums__disciplines", |
| 0 | 1446 | | schema: "syki"); |
| | 1447 | |
|
| 0 | 1448 | | migrationBuilder.DropTable( |
| 0 | 1449 | | name: "courses__disciplines", |
| 0 | 1450 | | schema: "syki"); |
| | 1451 | |
|
| 0 | 1452 | | migrationBuilder.DropTable( |
| 0 | 1453 | | name: "domain_events", |
| 0 | 1454 | | schema: "syki"); |
| | 1455 | |
|
| 0 | 1456 | | migrationBuilder.DropTable( |
| 0 | 1457 | | name: "enrollment_periods", |
| 0 | 1458 | | schema: "syki"); |
| | 1459 | |
|
| 0 | 1460 | | migrationBuilder.DropTable( |
| 0 | 1461 | | name: "feature_flags", |
| 0 | 1462 | | schema: "syki"); |
| | 1463 | |
|
| 0 | 1464 | | migrationBuilder.DropTable( |
| 0 | 1465 | | name: "institution_configs", |
| 0 | 1466 | | schema: "syki"); |
| | 1467 | |
|
| 0 | 1468 | | migrationBuilder.DropTable( |
| 0 | 1469 | | name: "reset_password_tokens", |
| 0 | 1470 | | schema: "syki"); |
| | 1471 | |
|
| 0 | 1472 | | migrationBuilder.DropTable( |
| 0 | 1473 | | name: "role_claims", |
| 0 | 1474 | | schema: "syki"); |
| | 1475 | |
|
| 0 | 1476 | | migrationBuilder.DropTable( |
| 0 | 1477 | | name: "schedules", |
| 0 | 1478 | | schema: "syki"); |
| | 1479 | |
|
| 0 | 1480 | | migrationBuilder.DropTable( |
| 0 | 1481 | | name: "student_class_notes", |
| 0 | 1482 | | schema: "syki"); |
| | 1483 | |
|
| 0 | 1484 | | migrationBuilder.DropTable( |
| 0 | 1485 | | name: "user_claims", |
| 0 | 1486 | | schema: "syki"); |
| | 1487 | |
|
| 0 | 1488 | | migrationBuilder.DropTable( |
| 0 | 1489 | | name: "user_logins", |
| 0 | 1490 | | schema: "syki"); |
| | 1491 | |
|
| 0 | 1492 | | migrationBuilder.DropTable( |
| 0 | 1493 | | name: "user_registers", |
| 0 | 1494 | | schema: "syki"); |
| | 1495 | |
|
| 0 | 1496 | | migrationBuilder.DropTable( |
| 0 | 1497 | | name: "user_roles", |
| 0 | 1498 | | schema: "syki"); |
| | 1499 | |
|
| 0 | 1500 | | migrationBuilder.DropTable( |
| 0 | 1501 | | name: "user_tokens", |
| 0 | 1502 | | schema: "syki"); |
| | 1503 | |
|
| 0 | 1504 | | migrationBuilder.DropTable( |
| 0 | 1505 | | name: "users__notifications", |
| 0 | 1506 | | schema: "syki"); |
| | 1507 | |
|
| 0 | 1508 | | migrationBuilder.DropTable( |
| 0 | 1509 | | name: "webhook_authentications", |
| 0 | 1510 | | schema: "syki"); |
| | 1511 | |
|
| 0 | 1512 | | migrationBuilder.DropTable( |
| 0 | 1513 | | name: "webhook_call_attempts", |
| 0 | 1514 | | schema: "syki"); |
| | 1515 | |
|
| 0 | 1516 | | migrationBuilder.DropTable( |
| 0 | 1517 | | name: "class_activities", |
| 0 | 1518 | | schema: "syki"); |
| | 1519 | |
|
| 0 | 1520 | | migrationBuilder.DropTable( |
| 0 | 1521 | | name: "class_lessons", |
| 0 | 1522 | | schema: "syki"); |
| | 1523 | |
|
| 0 | 1524 | | migrationBuilder.DropTable( |
| 0 | 1525 | | name: "students", |
| 0 | 1526 | | schema: "syki"); |
| | 1527 | |
|
| 0 | 1528 | | migrationBuilder.DropTable( |
| 0 | 1529 | | name: "roles", |
| 0 | 1530 | | schema: "syki"); |
| | 1531 | |
|
| 0 | 1532 | | migrationBuilder.DropTable( |
| 0 | 1533 | | name: "notifications", |
| 0 | 1534 | | schema: "syki"); |
| | 1535 | |
|
| 0 | 1536 | | migrationBuilder.DropTable( |
| 0 | 1537 | | name: "webhook_calls", |
| 0 | 1538 | | schema: "syki"); |
| | 1539 | |
|
| 0 | 1540 | | migrationBuilder.DropTable( |
| 0 | 1541 | | name: "classes", |
| 0 | 1542 | | schema: "syki"); |
| | 1543 | |
|
| 0 | 1544 | | migrationBuilder.DropTable( |
| 0 | 1545 | | name: "course_offerings", |
| 0 | 1546 | | schema: "syki"); |
| | 1547 | |
|
| 0 | 1548 | | migrationBuilder.DropTable( |
| 0 | 1549 | | name: "webhook_subscriptions", |
| 0 | 1550 | | schema: "syki"); |
| | 1551 | |
|
| 0 | 1552 | | migrationBuilder.DropTable( |
| 0 | 1553 | | name: "disciplines", |
| 0 | 1554 | | schema: "syki"); |
| | 1555 | |
|
| 0 | 1556 | | migrationBuilder.DropTable( |
| 0 | 1557 | | name: "teachers", |
| 0 | 1558 | | schema: "syki"); |
| | 1559 | |
|
| 0 | 1560 | | migrationBuilder.DropTable( |
| 0 | 1561 | | name: "academic_periods", |
| 0 | 1562 | | schema: "syki"); |
| | 1563 | |
|
| 0 | 1564 | | migrationBuilder.DropTable( |
| 0 | 1565 | | name: "campi", |
| 0 | 1566 | | schema: "syki"); |
| | 1567 | |
|
| 0 | 1568 | | migrationBuilder.DropTable( |
| 0 | 1569 | | name: "course_curriculums", |
| 0 | 1570 | | schema: "syki"); |
| | 1571 | |
|
| 0 | 1572 | | migrationBuilder.DropTable( |
| 0 | 1573 | | name: "users", |
| 0 | 1574 | | schema: "syki"); |
| | 1575 | |
|
| 0 | 1576 | | migrationBuilder.DropTable( |
| 0 | 1577 | | name: "courses", |
| 0 | 1578 | | schema: "syki"); |
| | 1579 | |
|
| 0 | 1580 | | migrationBuilder.DropTable( |
| 0 | 1581 | | name: "institutions", |
| 0 | 1582 | | schema: "syki"); |
| 0 | 1583 | | } |
| | 1584 | | } |
| | 1585 | | } |