[MM-29217] Remove Posts.ParentId (#17923)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
757dc96461
Коммит
d181ae9262
@@ -5952,7 +5952,6 @@ func testChannelStoreGetPinnedPosts(t *testing.T, ss store.Store) {
|
||||
post3, err := ss.Post().Save(&model.Post{
|
||||
ChannelId: channelId,
|
||||
UserId: userId,
|
||||
ParentId: post1.Id,
|
||||
RootId: post1.Id,
|
||||
Message: "message",
|
||||
IsPinned: true,
|
||||
|
||||
@@ -658,7 +658,6 @@ func testFileInfoStoreGetFilesBatchForIndexing(t *testing.T, ss store.Store) {
|
||||
o3 := &model.Post{}
|
||||
o3.ChannelId = c1.Id
|
||||
o3.UserId = model.NewId()
|
||||
o3.ParentId = o1.Id
|
||||
o3.RootId = o1.Id
|
||||
o3.Message = "zz" + model.NewId() + "QQQQQQQQQQ"
|
||||
o3, err = ss.Post().Save(o3)
|
||||
|
||||
@@ -525,7 +525,6 @@ func testPostStoreUpdate(t *testing.T, ss store.Store) {
|
||||
o2.ChannelId = o1.ChannelId
|
||||
o2.UserId = model.NewId()
|
||||
o2.Message = "zz" + model.NewId() + "CCCCCCCCC"
|
||||
o2.ParentId = o1.Id
|
||||
o2.RootId = o1.Id
|
||||
o2, err = ss.Post().Save(o2)
|
||||
require.NoError(t, err)
|
||||
@@ -657,7 +656,6 @@ func testPostStoreDelete1Level(t *testing.T, ss store.Store) {
|
||||
o2.ChannelId = o1.ChannelId
|
||||
o2.UserId = model.NewId()
|
||||
o2.Message = "zz" + model.NewId() + "b"
|
||||
o2.ParentId = o1.Id
|
||||
o2.RootId = o1.Id
|
||||
o2, err = ss.Post().Save(o2)
|
||||
require.NoError(t, err)
|
||||
@@ -684,7 +682,6 @@ func testPostStoreDelete2Level(t *testing.T, ss store.Store) {
|
||||
o2.ChannelId = o1.ChannelId
|
||||
o2.UserId = model.NewId()
|
||||
o2.Message = "zz" + model.NewId() + "b"
|
||||
o2.ParentId = o1.Id
|
||||
o2.RootId = o1.Id
|
||||
o2, err = ss.Post().Save(o2)
|
||||
require.NoError(t, err)
|
||||
@@ -693,7 +690,6 @@ func testPostStoreDelete2Level(t *testing.T, ss store.Store) {
|
||||
o3.ChannelId = o1.ChannelId
|
||||
o3.UserId = model.NewId()
|
||||
o3.Message = "zz" + model.NewId() + "b"
|
||||
o3.ParentId = o2.Id
|
||||
o3.RootId = o1.Id
|
||||
o3, err = ss.Post().Save(o3)
|
||||
require.NoError(t, err)
|
||||
@@ -733,7 +729,6 @@ func testPostStorePermDelete1Level(t *testing.T, ss store.Store) {
|
||||
o2.ChannelId = o1.ChannelId
|
||||
o2.UserId = model.NewId()
|
||||
o2.Message = "zz" + model.NewId() + "b"
|
||||
o2.ParentId = o1.Id
|
||||
o2.RootId = o1.Id
|
||||
o2, err = ss.Post().Save(o2)
|
||||
require.NoError(t, err)
|
||||
@@ -773,7 +768,6 @@ func testPostStorePermDelete1Level2(t *testing.T, ss store.Store) {
|
||||
o2.ChannelId = o1.ChannelId
|
||||
o2.UserId = model.NewId()
|
||||
o2.Message = "zz" + model.NewId() + "b"
|
||||
o2.ParentId = o1.Id
|
||||
o2.RootId = o1.Id
|
||||
o2, err = ss.Post().Save(o2)
|
||||
require.NoError(t, err)
|
||||
@@ -810,7 +804,6 @@ func testPostStoreGetWithChildren(t *testing.T, ss store.Store) {
|
||||
o2.ChannelId = o1.ChannelId
|
||||
o2.UserId = model.NewId()
|
||||
o2.Message = "zz" + model.NewId() + "b"
|
||||
o2.ParentId = o1.Id
|
||||
o2.RootId = o1.Id
|
||||
o2, err = ss.Post().Save(o2)
|
||||
require.NoError(t, err)
|
||||
@@ -819,7 +812,6 @@ func testPostStoreGetWithChildren(t *testing.T, ss store.Store) {
|
||||
o3.ChannelId = o1.ChannelId
|
||||
o3.UserId = model.NewId()
|
||||
o3.Message = "zz" + model.NewId() + "b"
|
||||
o3.ParentId = o2.Id
|
||||
o3.RootId = o1.Id
|
||||
o3, err = ss.Post().Save(o3)
|
||||
require.NoError(t, err)
|
||||
@@ -859,7 +851,6 @@ func testPostStoreGetPostsWithDetails(t *testing.T, ss store.Store) {
|
||||
o2.ChannelId = o1.ChannelId
|
||||
o2.UserId = model.NewId()
|
||||
o2.Message = "zz" + model.NewId() + "b"
|
||||
o2.ParentId = o1.Id
|
||||
o2.RootId = o1.Id
|
||||
_, err = ss.Post().Save(o2)
|
||||
require.NoError(t, err)
|
||||
@@ -869,7 +860,6 @@ func testPostStoreGetPostsWithDetails(t *testing.T, ss store.Store) {
|
||||
o2a.ChannelId = o1.ChannelId
|
||||
o2a.UserId = model.NewId()
|
||||
o2a.Message = "zz" + model.NewId() + "b"
|
||||
o2a.ParentId = o1.Id
|
||||
o2a.RootId = o1.Id
|
||||
o2a, err = ss.Post().Save(o2a)
|
||||
require.NoError(t, err)
|
||||
@@ -879,7 +869,6 @@ func testPostStoreGetPostsWithDetails(t *testing.T, ss store.Store) {
|
||||
o3.ChannelId = o1.ChannelId
|
||||
o3.UserId = model.NewId()
|
||||
o3.Message = "zz" + model.NewId() + "b"
|
||||
o3.ParentId = o1.Id
|
||||
o3.RootId = o1.Id
|
||||
o3, err = ss.Post().Save(o3)
|
||||
require.NoError(t, err)
|
||||
@@ -897,7 +886,6 @@ func testPostStoreGetPostsWithDetails(t *testing.T, ss store.Store) {
|
||||
o5.ChannelId = o1.ChannelId
|
||||
o5.UserId = model.NewId()
|
||||
o5.Message = "zz" + model.NewId() + "b"
|
||||
o5.ParentId = o4.Id
|
||||
o5.RootId = o4.Id
|
||||
o5, err = ss.Post().Save(o5)
|
||||
require.NoError(t, err)
|
||||
@@ -1073,7 +1061,6 @@ func testPostStoreGetPostsBeforeAfter(t *testing.T, ss store.Store) {
|
||||
post3, err := ss.Post().Save(&model.Post{
|
||||
ChannelId: channelId,
|
||||
UserId: userId,
|
||||
ParentId: post1.Id,
|
||||
RootId: post1.Id,
|
||||
Message: "message",
|
||||
})
|
||||
@@ -1085,7 +1072,6 @@ func testPostStoreGetPostsBeforeAfter(t *testing.T, ss store.Store) {
|
||||
ChannelId: channelId,
|
||||
UserId: userId,
|
||||
RootId: post2.Id,
|
||||
ParentId: post2.Id,
|
||||
Message: "message",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -1103,7 +1089,6 @@ func testPostStoreGetPostsBeforeAfter(t *testing.T, ss store.Store) {
|
||||
post6, err := ss.Post().Save(&model.Post{
|
||||
ChannelId: channelId,
|
||||
UserId: userId,
|
||||
ParentId: post2.Id,
|
||||
RootId: post2.Id,
|
||||
Message: "message",
|
||||
})
|
||||
@@ -1174,7 +1159,6 @@ func testPostStoreGetPostsBeforeAfter(t *testing.T, ss store.Store) {
|
||||
post3, err := ss.Post().Save(&model.Post{
|
||||
ChannelId: channelId,
|
||||
UserId: userId,
|
||||
ParentId: post1.Id,
|
||||
RootId: post1.Id,
|
||||
Message: "post3",
|
||||
})
|
||||
@@ -1186,7 +1170,6 @@ func testPostStoreGetPostsBeforeAfter(t *testing.T, ss store.Store) {
|
||||
ChannelId: channelId,
|
||||
UserId: userId,
|
||||
RootId: post2.Id,
|
||||
ParentId: post2.Id,
|
||||
Message: "post4",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -1204,7 +1187,6 @@ func testPostStoreGetPostsBeforeAfter(t *testing.T, ss store.Store) {
|
||||
post6, err := ss.Post().Save(&model.Post{
|
||||
ChannelId: channelId,
|
||||
UserId: userId,
|
||||
ParentId: post2.Id,
|
||||
RootId: post2.Id,
|
||||
Message: "post6",
|
||||
})
|
||||
@@ -1283,7 +1265,6 @@ func testPostStoreGetPostsBeforeAfter(t *testing.T, ss store.Store) {
|
||||
post3, err := ss.Post().Save(&model.Post{
|
||||
ChannelId: channelId,
|
||||
UserId: userId,
|
||||
ParentId: post1.Id,
|
||||
RootId: post1.Id,
|
||||
Message: "post3",
|
||||
})
|
||||
@@ -1295,7 +1276,6 @@ func testPostStoreGetPostsBeforeAfter(t *testing.T, ss store.Store) {
|
||||
ChannelId: channelId,
|
||||
UserId: userId,
|
||||
RootId: post2.Id,
|
||||
ParentId: post2.Id,
|
||||
Message: "post4",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
@@ -1313,7 +1293,6 @@ func testPostStoreGetPostsBeforeAfter(t *testing.T, ss store.Store) {
|
||||
post6, err := ss.Post().Save(&model.Post{
|
||||
ChannelId: channelId,
|
||||
UserId: userId,
|
||||
ParentId: post2.Id,
|
||||
RootId: post2.Id,
|
||||
Message: "post6",
|
||||
})
|
||||
@@ -1606,7 +1585,6 @@ func testPostStoreGetPostBeforeAfter(t *testing.T, ss store.Store) {
|
||||
o0a.ChannelId = channelId
|
||||
o0a.UserId = model.NewId()
|
||||
o0a.Message = "zz" + model.NewId() + "b"
|
||||
o0a.ParentId = o1.Id
|
||||
o0a.RootId = o1.Id
|
||||
_, err = ss.Post().Save(o0a)
|
||||
require.NoError(t, err)
|
||||
@@ -1616,7 +1594,6 @@ func testPostStoreGetPostBeforeAfter(t *testing.T, ss store.Store) {
|
||||
o0b.ChannelId = channelId
|
||||
o0b.UserId = model.NewId()
|
||||
o0b.Message = "deleted message"
|
||||
o0b.ParentId = o1.Id
|
||||
o0b.RootId = o1.Id
|
||||
o0b.DeleteAt = 1
|
||||
_, err = ss.Post().Save(o0b)
|
||||
@@ -1643,7 +1620,6 @@ func testPostStoreGetPostBeforeAfter(t *testing.T, ss store.Store) {
|
||||
o2a.ChannelId = channelId
|
||||
o2a.UserId = model.NewId()
|
||||
o2a.Message = "zz" + model.NewId() + "b"
|
||||
o2a.ParentId = o2.Id
|
||||
o2a.RootId = o2.Id
|
||||
_, err = ss.Post().Save(o2a)
|
||||
require.NoError(t, err)
|
||||
@@ -2252,7 +2228,6 @@ func testPostStoreGetPostsCreatedAt(t *testing.T, ss store.Store) {
|
||||
o2.ChannelId = o1.ChannelId
|
||||
o2.UserId = model.NewId()
|
||||
o2.Message = "zz" + model.NewId() + "b"
|
||||
o2.ParentId = o1.Id
|
||||
o2.RootId = o1.Id
|
||||
o2.CreateAt = createTime + 1
|
||||
_, err = ss.Post().Save(o2)
|
||||
@@ -2282,7 +2257,6 @@ func testPostStoreOverwriteMultiple(t *testing.T, ss store.Store) {
|
||||
o2.ChannelId = o1.ChannelId
|
||||
o2.UserId = model.NewId()
|
||||
o2.Message = "zz" + model.NewId() + "CCCCCCCCC"
|
||||
o2.ParentId = o1.Id
|
||||
o2.RootId = o1.Id
|
||||
o2, err = ss.Post().Save(o2)
|
||||
require.NoError(t, err)
|
||||
@@ -2409,7 +2383,6 @@ func testPostStoreOverwrite(t *testing.T, ss store.Store) {
|
||||
o2.ChannelId = o1.ChannelId
|
||||
o2.UserId = model.NewId()
|
||||
o2.Message = "zz" + model.NewId() + "CCCCCCCCC"
|
||||
o2.ParentId = o1.Id
|
||||
o2.RootId = o1.Id
|
||||
o2, err = ss.Post().Save(o2)
|
||||
require.NoError(t, err)
|
||||
@@ -2583,7 +2556,6 @@ func testPostStoreGetPostsBatchForIndexing(t *testing.T, ss store.Store) {
|
||||
o3 := &model.Post{}
|
||||
o3.ChannelId = c1.Id
|
||||
o3.UserId = model.NewId()
|
||||
o3.ParentId = o1.Id
|
||||
o3.RootId = o1.Id
|
||||
o3.Message = "zz" + model.NewId() + "QQQQQQQQQQ"
|
||||
o3, err = ss.Post().Save(o3)
|
||||
@@ -2935,7 +2907,6 @@ func testPostStoreGetRepliesForExport(t *testing.T, ss store.Store) {
|
||||
p2.UserId = u1.Id
|
||||
p2.Message = "zz" + model.NewId() + "AAAAAAAAAAA"
|
||||
p2.CreateAt = 1001
|
||||
p2.ParentId = p1.Id
|
||||
p2.RootId = p1.Id
|
||||
p2, nErr = ss.Post().Save(p2)
|
||||
require.NoError(t, nErr)
|
||||
|
||||
@@ -455,7 +455,6 @@ func threadStoreCreateReply(t *testing.T, ss store.Store, channelID, postID stri
|
||||
UserId: model.NewId(),
|
||||
CreateAt: createAt,
|
||||
RootId: postID,
|
||||
ParentId: postID,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
return reply
|
||||
|
||||
Ссылка в новой задаче
Block a user