|
| 1 | +/* |
| 2 | + * Copyright 2022 MONAI Consortium |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +using Microsoft.EntityFrameworkCore.Migrations; |
| 18 | + |
| 19 | +#nullable disable |
| 20 | + |
| 21 | +namespace Monai.Deploy.InformaticsGateway.Database.Migrations |
| 22 | +{ |
| 23 | + public partial class R3_030 : Migration |
| 24 | + { |
| 25 | + protected override void Up(MigrationBuilder migrationBuilder) |
| 26 | + { |
| 27 | + migrationBuilder.DropColumn( |
| 28 | + name: "StoragePath", |
| 29 | + table: "InferenceRequest"); |
| 30 | + |
| 31 | + migrationBuilder.CreateTable( |
| 32 | + name: "StorageMetadataWrapper", |
| 33 | + columns: table => new |
| 34 | + { |
| 35 | + CorrelationId = table.Column<string>(type: "TEXT", nullable: false), |
| 36 | + Identity = table.Column<string>(type: "TEXT", nullable: false), |
| 37 | + Value = table.Column<string>(type: "TEXT", nullable: true), |
| 38 | + TypeName = table.Column<string>(type: "TEXT", nullable: true), |
| 39 | + IsUploaded = table.Column<bool>(type: "INTEGER", nullable: false) |
| 40 | + }, |
| 41 | + constraints: table => |
| 42 | + { |
| 43 | + table.PrimaryKey("PK_StorageMetadataWrapper", x => new { x.CorrelationId, x.Identity }); |
| 44 | + }); |
| 45 | + } |
| 46 | + |
| 47 | + protected override void Down(MigrationBuilder migrationBuilder) |
| 48 | + { |
| 49 | + migrationBuilder.DropTable( |
| 50 | + name: "StorageMetadataWrapper"); |
| 51 | + |
| 52 | + migrationBuilder.AddColumn<string>( |
| 53 | + name: "StoragePath", |
| 54 | + table: "InferenceRequest", |
| 55 | + type: "TEXT", |
| 56 | + nullable: false, |
| 57 | + defaultValue: ""); |
| 58 | + } |
| 59 | + } |
| 60 | +} |
0 commit comments