Chore: remove comments feature (#64644)

This commit is contained in:
Ryan McKinley
2023-03-11 04:28:12 -08:00
committed by GitHub
parent 18e3e0ca8d
commit d5a9a0cea0
30 changed files with 2 additions and 1262 deletions
@@ -1,46 +0,0 @@
package migrations
import (
. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
)
func addCommentGroupMigrations(mg *Migrator) {
commentGroupTable := Table{
Name: "comment_group",
Columns: []*Column{
{Name: "id", Type: DB_BigInt, Nullable: false, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "org_id", Type: DB_BigInt, Nullable: false},
{Name: "object_type", Type: DB_NVarchar, Length: 10, Nullable: false},
{Name: "object_id", Type: DB_NVarchar, Length: 128, Nullable: false},
{Name: "settings", Type: DB_MediumText, Nullable: false},
{Name: "created", Type: DB_Int, Nullable: false},
{Name: "updated", Type: DB_Int, Nullable: false},
},
Indices: []*Index{
{Cols: []string{"org_id", "object_type", "object_id"}, Type: UniqueIndex},
},
}
mg.AddMigration("create comment group table", NewAddTableMigration(commentGroupTable))
mg.AddMigration("add index comment_group.org_id_object_type_object_id", NewAddIndexMigration(commentGroupTable, commentGroupTable.Indices[0]))
}
func addCommentMigrations(mg *Migrator) {
commentTable := Table{
Name: "comment",
Columns: []*Column{
{Name: "id", Type: DB_BigInt, Nullable: false, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "group_id", Type: DB_BigInt, Nullable: false},
{Name: "user_id", Type: DB_BigInt, Nullable: false},
{Name: "content", Type: DB_MediumText, Nullable: false},
{Name: "created", Type: DB_Int, Nullable: false},
{Name: "updated", Type: DB_Int, Nullable: false},
},
Indices: []*Index{
{Cols: []string{"group_id"}, Type: IndexType},
{Cols: []string{"created"}, Type: IndexType},
},
}
mg.AddMigration("create comment table", NewAddTableMigration(commentTable))
mg.AddMigration("add index comment.group_id", NewAddIndexMigration(commentTable, commentTable.Indices[0]))
mg.AddMigration("add index comment.created", NewAddIndexMigration(commentTable, commentTable.Indices[1]))
}
@@ -75,11 +75,6 @@ func (*OSSMigrations) AddMigration(mg *Migrator) {
addCorrelationsMigrations(mg)
if mg.Cfg != nil && mg.Cfg.IsFeatureToggleEnabled != nil {
if mg.Cfg.IsFeatureToggleEnabled(featuremgmt.FlagDashboardComments) || mg.Cfg.IsFeatureToggleEnabled(featuremgmt.FlagAnnotationComments) {
addCommentGroupMigrations(mg)
addCommentMigrations(mg)
}
if mg.Cfg.IsFeatureToggleEnabled(featuremgmt.FlagEntityStore) {
addEntityStoreMigrations(mg)
}