| | | 1 | | using Microsoft.EntityFrameworkCore.Migrations; |
| | | 2 | | |
| | | 3 | | #nullable disable |
| | | 4 | | |
| | | 5 | | namespace Elsa.Persistence.EFCore.Sqlite.Migrations.Runtime |
| | | 6 | | { |
| | | 7 | | /// <inheritdoc /> |
| | | 8 | | public partial class Initial : Migration |
| | | 9 | | { |
| | | 10 | | /// <inheritdoc /> |
| | | 11 | | protected override void Up(MigrationBuilder migrationBuilder) |
| | | 12 | | { |
| | 0 | 13 | | migrationBuilder.CreateTable( |
| | 0 | 14 | | name: "ActivityExecutionRecords", |
| | 0 | 15 | | columns: table => new |
| | 0 | 16 | | { |
| | 0 | 17 | | Id = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 18 | | WorkflowInstanceId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 19 | | ActivityId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 20 | | ActivityNodeId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 21 | | ActivityType = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 22 | | ActivityTypeVersion = table.Column<int>(type: "INTEGER", nullable: false), |
| | 0 | 23 | | ActivityName = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 24 | | StartedAt = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 25 | | HasBookmarks = table.Column<bool>(type: "INTEGER", nullable: false), |
| | 0 | 26 | | Status = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 27 | | CompletedAt = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 28 | | SerializedActivityState = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 29 | | SerializedException = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 30 | | SerializedOutputs = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 31 | | SerializedPayload = table.Column<string>(type: "TEXT", nullable: true) |
| | 0 | 32 | | }, |
| | 0 | 33 | | constraints: table => |
| | 0 | 34 | | { |
| | 0 | 35 | | table.PrimaryKey("PK_ActivityExecutionRecords", x => x.Id); |
| | 0 | 36 | | }); |
| | | 37 | | |
| | 0 | 38 | | migrationBuilder.CreateTable( |
| | 0 | 39 | | name: "Bookmarks", |
| | 0 | 40 | | columns: table => new |
| | 0 | 41 | | { |
| | 0 | 42 | | BookmarkId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 43 | | ActivityTypeName = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 44 | | Hash = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 45 | | WorkflowInstanceId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 46 | | ActivityInstanceId = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 47 | | CorrelationId = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 48 | | CreatedAt = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 49 | | SerializedMetadata = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 50 | | SerializedPayload = table.Column<string>(type: "TEXT", nullable: true) |
| | 0 | 51 | | }, |
| | 0 | 52 | | constraints: table => |
| | 0 | 53 | | { |
| | 0 | 54 | | table.PrimaryKey("PK_Bookmarks", x => x.BookmarkId); |
| | 0 | 55 | | }); |
| | | 56 | | |
| | 0 | 57 | | migrationBuilder.CreateTable( |
| | 0 | 58 | | name: "Triggers", |
| | 0 | 59 | | columns: table => new |
| | 0 | 60 | | { |
| | 0 | 61 | | Id = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 62 | | WorkflowDefinitionId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 63 | | WorkflowDefinitionVersionId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 64 | | Name = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 65 | | ActivityId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 66 | | Hash = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 67 | | SerializedPayload = table.Column<string>(type: "TEXT", nullable: true) |
| | 0 | 68 | | }, |
| | 0 | 69 | | constraints: table => |
| | 0 | 70 | | { |
| | 0 | 71 | | table.PrimaryKey("PK_Triggers", x => x.Id); |
| | 0 | 72 | | }); |
| | | 73 | | |
| | 0 | 74 | | migrationBuilder.CreateTable( |
| | 0 | 75 | | name: "WorkflowExecutionLogRecords", |
| | 0 | 76 | | columns: table => new |
| | 0 | 77 | | { |
| | 0 | 78 | | Id = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 79 | | WorkflowDefinitionId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 80 | | WorkflowDefinitionVersionId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 81 | | WorkflowInstanceId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 82 | | WorkflowVersion = table.Column<int>(type: "INTEGER", nullable: false), |
| | 0 | 83 | | ActivityInstanceId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 84 | | ParentActivityInstanceId = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 85 | | ActivityId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 86 | | ActivityType = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 87 | | ActivityTypeVersion = table.Column<int>(type: "INTEGER", nullable: false), |
| | 0 | 88 | | ActivityName = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 89 | | ActivityNodeId = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 90 | | Timestamp = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 91 | | Sequence = table.Column<long>(type: "INTEGER", nullable: false), |
| | 0 | 92 | | EventName = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 93 | | Message = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 94 | | Source = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 95 | | SerializedActivityState = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 96 | | SerializedPayload = table.Column<string>(type: "TEXT", nullable: true) |
| | 0 | 97 | | }, |
| | 0 | 98 | | constraints: table => |
| | 0 | 99 | | { |
| | 0 | 100 | | table.PrimaryKey("PK_WorkflowExecutionLogRecords", x => x.Id); |
| | 0 | 101 | | }); |
| | | 102 | | |
| | 0 | 103 | | migrationBuilder.CreateTable( |
| | 0 | 104 | | name: "WorkflowInboxMessages", |
| | 0 | 105 | | columns: table => new |
| | 0 | 106 | | { |
| | 0 | 107 | | Id = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 108 | | ActivityTypeName = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 109 | | Hash = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 110 | | WorkflowInstanceId = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 111 | | CorrelationId = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 112 | | ActivityInstanceId = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 113 | | CreatedAt = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 114 | | ExpiresAt = table.Column<string>(type: "TEXT", nullable: false), |
| | 0 | 115 | | SerializedBookmarkPayload = table.Column<string>(type: "TEXT", nullable: true), |
| | 0 | 116 | | SerializedInput = table.Column<string>(type: "TEXT", nullable: true) |
| | 0 | 117 | | }, |
| | 0 | 118 | | constraints: table => |
| | 0 | 119 | | { |
| | 0 | 120 | | table.PrimaryKey("PK_WorkflowInboxMessages", x => x.Id); |
| | 0 | 121 | | }); |
| | | 122 | | |
| | 0 | 123 | | migrationBuilder.CreateIndex( |
| | 0 | 124 | | name: "IX_ActivityExecutionRecord_ActivityId", |
| | 0 | 125 | | table: "ActivityExecutionRecords", |
| | 0 | 126 | | column: "ActivityId"); |
| | | 127 | | |
| | 0 | 128 | | migrationBuilder.CreateIndex( |
| | 0 | 129 | | name: "IX_ActivityExecutionRecord_ActivityName", |
| | 0 | 130 | | table: "ActivityExecutionRecords", |
| | 0 | 131 | | column: "ActivityName"); |
| | | 132 | | |
| | 0 | 133 | | migrationBuilder.CreateIndex( |
| | 0 | 134 | | name: "IX_ActivityExecutionRecord_ActivityNodeId", |
| | 0 | 135 | | table: "ActivityExecutionRecords", |
| | 0 | 136 | | column: "ActivityNodeId"); |
| | | 137 | | |
| | 0 | 138 | | migrationBuilder.CreateIndex( |
| | 0 | 139 | | name: "IX_ActivityExecutionRecord_ActivityType", |
| | 0 | 140 | | table: "ActivityExecutionRecords", |
| | 0 | 141 | | column: "ActivityType"); |
| | | 142 | | |
| | 0 | 143 | | migrationBuilder.CreateIndex( |
| | 0 | 144 | | name: "IX_ActivityExecutionRecord_ActivityType_ActivityTypeVersion", |
| | 0 | 145 | | table: "ActivityExecutionRecords", |
| | 0 | 146 | | columns: new[] { "ActivityType", "ActivityTypeVersion" }); |
| | | 147 | | |
| | 0 | 148 | | migrationBuilder.CreateIndex( |
| | 0 | 149 | | name: "IX_ActivityExecutionRecord_ActivityTypeVersion", |
| | 0 | 150 | | table: "ActivityExecutionRecords", |
| | 0 | 151 | | column: "ActivityTypeVersion"); |
| | | 152 | | |
| | 0 | 153 | | migrationBuilder.CreateIndex( |
| | 0 | 154 | | name: "IX_ActivityExecutionRecord_CompletedAt", |
| | 0 | 155 | | table: "ActivityExecutionRecords", |
| | 0 | 156 | | column: "CompletedAt"); |
| | | 157 | | |
| | 0 | 158 | | migrationBuilder.CreateIndex( |
| | 0 | 159 | | name: "IX_ActivityExecutionRecord_HasBookmarks", |
| | 0 | 160 | | table: "ActivityExecutionRecords", |
| | 0 | 161 | | column: "HasBookmarks"); |
| | | 162 | | |
| | 0 | 163 | | migrationBuilder.CreateIndex( |
| | 0 | 164 | | name: "IX_ActivityExecutionRecord_StartedAt", |
| | 0 | 165 | | table: "ActivityExecutionRecords", |
| | 0 | 166 | | column: "StartedAt"); |
| | | 167 | | |
| | 0 | 168 | | migrationBuilder.CreateIndex( |
| | 0 | 169 | | name: "IX_ActivityExecutionRecord_Status", |
| | 0 | 170 | | table: "ActivityExecutionRecords", |
| | 0 | 171 | | column: "Status"); |
| | | 172 | | |
| | 0 | 173 | | migrationBuilder.CreateIndex( |
| | 0 | 174 | | name: "IX_ActivityExecutionRecord_WorkflowInstanceId", |
| | 0 | 175 | | table: "ActivityExecutionRecords", |
| | 0 | 176 | | column: "WorkflowInstanceId"); |
| | | 177 | | |
| | 0 | 178 | | migrationBuilder.CreateIndex( |
| | 0 | 179 | | name: "IX_StoredBookmark_ActivityInstanceId", |
| | 0 | 180 | | table: "Bookmarks", |
| | 0 | 181 | | column: "ActivityInstanceId"); |
| | | 182 | | |
| | 0 | 183 | | migrationBuilder.CreateIndex( |
| | 0 | 184 | | name: "IX_StoredBookmark_ActivityTypeName", |
| | 0 | 185 | | table: "Bookmarks", |
| | 0 | 186 | | column: "ActivityTypeName"); |
| | | 187 | | |
| | 0 | 188 | | migrationBuilder.CreateIndex( |
| | 0 | 189 | | name: "IX_StoredBookmark_ActivityTypeName_Hash", |
| | 0 | 190 | | table: "Bookmarks", |
| | 0 | 191 | | columns: new[] { "ActivityTypeName", "Hash" }); |
| | | 192 | | |
| | 0 | 193 | | migrationBuilder.CreateIndex( |
| | 0 | 194 | | name: "IX_StoredBookmark_ActivityTypeName_Hash_WorkflowInstanceId", |
| | 0 | 195 | | table: "Bookmarks", |
| | 0 | 196 | | columns: new[] { "ActivityTypeName", "Hash", "WorkflowInstanceId" }); |
| | | 197 | | |
| | 0 | 198 | | migrationBuilder.CreateIndex( |
| | 0 | 199 | | name: "IX_StoredBookmark_CreatedAt", |
| | 0 | 200 | | table: "Bookmarks", |
| | 0 | 201 | | column: "CreatedAt"); |
| | | 202 | | |
| | 0 | 203 | | migrationBuilder.CreateIndex( |
| | 0 | 204 | | name: "IX_StoredBookmark_Hash", |
| | 0 | 205 | | table: "Bookmarks", |
| | 0 | 206 | | column: "Hash"); |
| | | 207 | | |
| | 0 | 208 | | migrationBuilder.CreateIndex( |
| | 0 | 209 | | name: "IX_StoredBookmark_WorkflowInstanceId", |
| | 0 | 210 | | table: "Bookmarks", |
| | 0 | 211 | | column: "WorkflowInstanceId"); |
| | | 212 | | |
| | 0 | 213 | | migrationBuilder.CreateIndex( |
| | 0 | 214 | | name: "IX_StoredTrigger_Hash", |
| | 0 | 215 | | table: "Triggers", |
| | 0 | 216 | | column: "Hash"); |
| | | 217 | | |
| | 0 | 218 | | migrationBuilder.CreateIndex( |
| | 0 | 219 | | name: "IX_StoredTrigger_Name", |
| | 0 | 220 | | table: "Triggers", |
| | 0 | 221 | | column: "Name"); |
| | | 222 | | |
| | 0 | 223 | | migrationBuilder.CreateIndex( |
| | 0 | 224 | | name: "IX_StoredTrigger_WorkflowDefinitionId", |
| | 0 | 225 | | table: "Triggers", |
| | 0 | 226 | | column: "WorkflowDefinitionId"); |
| | | 227 | | |
| | 0 | 228 | | migrationBuilder.CreateIndex( |
| | 0 | 229 | | name: "IX_StoredTrigger_WorkflowDefinitionVersionId", |
| | 0 | 230 | | table: "Triggers", |
| | 0 | 231 | | column: "WorkflowDefinitionVersionId"); |
| | | 232 | | |
| | 0 | 233 | | migrationBuilder.CreateIndex( |
| | 0 | 234 | | name: "IX_WorkflowExecutionLogRecord_ActivityId", |
| | 0 | 235 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 236 | | column: "ActivityId"); |
| | | 237 | | |
| | 0 | 238 | | migrationBuilder.CreateIndex( |
| | 0 | 239 | | name: "IX_WorkflowExecutionLogRecord_ActivityInstanceId", |
| | 0 | 240 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 241 | | column: "ActivityInstanceId"); |
| | | 242 | | |
| | 0 | 243 | | migrationBuilder.CreateIndex( |
| | 0 | 244 | | name: "IX_WorkflowExecutionLogRecord_ActivityName", |
| | 0 | 245 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 246 | | column: "ActivityName"); |
| | | 247 | | |
| | 0 | 248 | | migrationBuilder.CreateIndex( |
| | 0 | 249 | | name: "IX_WorkflowExecutionLogRecord_ActivityNodeId", |
| | 0 | 250 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 251 | | column: "ActivityNodeId"); |
| | | 252 | | |
| | 0 | 253 | | migrationBuilder.CreateIndex( |
| | 0 | 254 | | name: "IX_WorkflowExecutionLogRecord_ActivityType", |
| | 0 | 255 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 256 | | column: "ActivityType"); |
| | | 257 | | |
| | 0 | 258 | | migrationBuilder.CreateIndex( |
| | 0 | 259 | | name: "IX_WorkflowExecutionLogRecord_ActivityType_ActivityTypeVersion", |
| | 0 | 260 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 261 | | columns: new[] { "ActivityType", "ActivityTypeVersion" }); |
| | | 262 | | |
| | 0 | 263 | | migrationBuilder.CreateIndex( |
| | 0 | 264 | | name: "IX_WorkflowExecutionLogRecord_ActivityTypeVersion", |
| | 0 | 265 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 266 | | column: "ActivityTypeVersion"); |
| | | 267 | | |
| | 0 | 268 | | migrationBuilder.CreateIndex( |
| | 0 | 269 | | name: "IX_WorkflowExecutionLogRecord_EventName", |
| | 0 | 270 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 271 | | column: "EventName"); |
| | | 272 | | |
| | 0 | 273 | | migrationBuilder.CreateIndex( |
| | 0 | 274 | | name: "IX_WorkflowExecutionLogRecord_ParentActivityInstanceId", |
| | 0 | 275 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 276 | | column: "ParentActivityInstanceId"); |
| | | 277 | | |
| | 0 | 278 | | migrationBuilder.CreateIndex( |
| | 0 | 279 | | name: "IX_WorkflowExecutionLogRecord_Sequence", |
| | 0 | 280 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 281 | | column: "Sequence"); |
| | | 282 | | |
| | 0 | 283 | | migrationBuilder.CreateIndex( |
| | 0 | 284 | | name: "IX_WorkflowExecutionLogRecord_Timestamp", |
| | 0 | 285 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 286 | | column: "Timestamp"); |
| | | 287 | | |
| | 0 | 288 | | migrationBuilder.CreateIndex( |
| | 0 | 289 | | name: "IX_WorkflowExecutionLogRecord_Timestamp_Sequence", |
| | 0 | 290 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 291 | | columns: new[] { "Timestamp", "Sequence" }); |
| | | 292 | | |
| | 0 | 293 | | migrationBuilder.CreateIndex( |
| | 0 | 294 | | name: "IX_WorkflowExecutionLogRecord_WorkflowDefinitionId", |
| | 0 | 295 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 296 | | column: "WorkflowDefinitionId"); |
| | | 297 | | |
| | 0 | 298 | | migrationBuilder.CreateIndex( |
| | 0 | 299 | | name: "IX_WorkflowExecutionLogRecord_WorkflowDefinitionVersionId", |
| | 0 | 300 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 301 | | column: "WorkflowDefinitionVersionId"); |
| | | 302 | | |
| | 0 | 303 | | migrationBuilder.CreateIndex( |
| | 0 | 304 | | name: "IX_WorkflowExecutionLogRecord_WorkflowInstanceId", |
| | 0 | 305 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 306 | | column: "WorkflowInstanceId"); |
| | | 307 | | |
| | 0 | 308 | | migrationBuilder.CreateIndex( |
| | 0 | 309 | | name: "IX_WorkflowExecutionLogRecord_WorkflowVersion", |
| | 0 | 310 | | table: "WorkflowExecutionLogRecords", |
| | 0 | 311 | | column: "WorkflowVersion"); |
| | | 312 | | |
| | 0 | 313 | | migrationBuilder.CreateIndex( |
| | 0 | 314 | | name: "IX_WorkflowInboxMessage_ActivityInstanceId", |
| | 0 | 315 | | table: "WorkflowInboxMessages", |
| | 0 | 316 | | column: "ActivityInstanceId"); |
| | | 317 | | |
| | 0 | 318 | | migrationBuilder.CreateIndex( |
| | 0 | 319 | | name: "IX_WorkflowInboxMessage_ActivityTypeName", |
| | 0 | 320 | | table: "WorkflowInboxMessages", |
| | 0 | 321 | | column: "ActivityTypeName"); |
| | | 322 | | |
| | 0 | 323 | | migrationBuilder.CreateIndex( |
| | 0 | 324 | | name: "IX_WorkflowInboxMessage_CorrelationId", |
| | 0 | 325 | | table: "WorkflowInboxMessages", |
| | 0 | 326 | | column: "CorrelationId"); |
| | | 327 | | |
| | 0 | 328 | | migrationBuilder.CreateIndex( |
| | 0 | 329 | | name: "IX_WorkflowInboxMessage_CreatedAt", |
| | 0 | 330 | | table: "WorkflowInboxMessages", |
| | 0 | 331 | | column: "CreatedAt"); |
| | | 332 | | |
| | 0 | 333 | | migrationBuilder.CreateIndex( |
| | 0 | 334 | | name: "IX_WorkflowInboxMessage_ExpiresAt", |
| | 0 | 335 | | table: "WorkflowInboxMessages", |
| | 0 | 336 | | column: "ExpiresAt"); |
| | | 337 | | |
| | 0 | 338 | | migrationBuilder.CreateIndex( |
| | 0 | 339 | | name: "IX_WorkflowInboxMessage_Hash", |
| | 0 | 340 | | table: "WorkflowInboxMessages", |
| | 0 | 341 | | column: "Hash"); |
| | | 342 | | |
| | 0 | 343 | | migrationBuilder.CreateIndex( |
| | 0 | 344 | | name: "IX_WorkflowInboxMessage_WorkflowInstanceId", |
| | 0 | 345 | | table: "WorkflowInboxMessages", |
| | 0 | 346 | | column: "WorkflowInstanceId"); |
| | 0 | 347 | | } |
| | | 348 | | |
| | | 349 | | /// <inheritdoc /> |
| | | 350 | | protected override void Down(MigrationBuilder migrationBuilder) |
| | | 351 | | { |
| | 0 | 352 | | migrationBuilder.DropTable( |
| | 0 | 353 | | name: "ActivityExecutionRecords"); |
| | | 354 | | |
| | 0 | 355 | | migrationBuilder.DropTable( |
| | 0 | 356 | | name: "Bookmarks"); |
| | | 357 | | |
| | 0 | 358 | | migrationBuilder.DropTable( |
| | 0 | 359 | | name: "Triggers"); |
| | | 360 | | |
| | 0 | 361 | | migrationBuilder.DropTable( |
| | 0 | 362 | | name: "WorkflowExecutionLogRecords"); |
| | | 363 | | |
| | 0 | 364 | | migrationBuilder.DropTable( |
| | 0 | 365 | | name: "WorkflowInboxMessages"); |
| | 0 | 366 | | } |
| | | 367 | | } |
| | | 368 | | } |