Skip to content

Commit 521e7c0

Browse files
authored
Do not delete 'IndexingTask' table after the migration (#18071)
1 parent 4b059f0 commit 521e7c0

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

src/OrchardCore.Modules/OrchardCore.Indexing/Migrations.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ public int UpdateFrom4()
7777

7878
try
7979
{
80-
var previewIndexExists = false;
8180
await connection.OpenAsync();
8281
try
8382
{
@@ -99,28 +98,8 @@ public int UpdateFrom4()
9998
""";
10099

101100
await connection.ExecuteAsync(previewTableQuery);
102-
103-
previewIndexExists = true;
104101
}
105102

106-
// At this point, the 'RecordIndexingTask' table has been populated with the data from the 'IndexingTask' table.
107-
// It's safe to drop the old 'IndexingTask' table now.
108-
109-
var dropIndex = dialect.GetDropIndexString("IDX_IndexingTask_ContentItemId", indexingTaskTable, store.Configuration.Schema);
110-
111-
await connection.ExecuteAsync(dropIndex);
112-
113-
if (previewIndexExists)
114-
{
115-
// If the preview index was created, we need to drop it as well.
116-
var dropPreviewIndex = dialect.GetDropIndexString("IDX_IndexingTask_RecordId_Category", indexingTaskTable, store.Configuration.Schema);
117-
118-
await connection.ExecuteAsync(dropPreviewIndex);
119-
}
120-
121-
var dropTable = dialect.GetDropTableString(indexingTaskTable, store.Configuration.Schema);
122-
123-
await connection.ExecuteAsync(dropTable);
124103
await connection.CloseAsync();
125104
}
126105
catch (Exception e)

src/docs/releases/3.0.0.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ if(context.Record is ContentItem contentItem) {
5959

6060
- The `IIndexingTaskManager` interface was changed to be use as a universal task manager not only for content items. If you want to queue the content items in the index manager, you'll need to pass `Content` in the category argument. You may also store non-content-items in the index manager by passing a different category name.
6161

62-
The `IndexingTask` table in the database has been renamed to `RecordIndexingTask` to better reflect its purpose as a universal task manager.
62+
!!! warning
63+
The `IndexingTask` table in the database has been migrated to `RecordIndexingTask` to better reflect its purpose as a universal task manager. The `IndexingTask` table is kept intact to allow you to rollback your deployment if needed. If you no longer need that table, you can either manually delete it or create a migration in your project that deletes it.
6364

6465
### Elasticsearch Module
6566

0 commit comments

Comments
 (0)