Browse Source

annotations: removed category stuff, my mistake, we need tags

Torkel Ödegaard 8 years ago
parent
commit
0bae7212f6

+ 0 - 39
pkg/services/category/category.go

@@ -1,39 +0,0 @@
-package category
-
-type Repository interface {
-	Save(item *Item) error
-	Update(item *Item) error
-	Delete(params *DeleteParams) error
-	Find(query *FindParams) ([]*Item, error)
-}
-
-var repositoryInstance Repository
-
-func GetRepository() Repository {
-	return repositoryInstance
-}
-
-func SetRepository(rep Repository) {
-	repositoryInstance = rep
-}
-
-type FindParams struct {
-	OrgId  int64 `json:"orgId"`
-	UserId int64 `json:"userId"`
-	Limit  int64 `json:"limit"`
-}
-
-type DeleteParams struct {
-	Id   int64  `json:"id"`
-	Name string `json:"title"`
-}
-
-type ItemType string
-
-type Item struct {
-	Id          int64  `json:"id"`
-	OrgId       int64  `json:"orgId"`
-	UserId      int64  `json:"userId"`
-	Name        string `json:"title"`
-	Description string `json:"text"`
-}

+ 0 - 24
pkg/services/sqlstore/category.go

@@ -1,24 +0,0 @@
-package sqlstore
-
-import (
-	"github.com/grafana/grafana/pkg/services/category"
-)
-
-type SqlCategoryRepo struct {
-}
-
-func (r *SqlCategoryRepo) Save(item *category.Item) error {
-	return nil
-}
-
-func (r *SqlCategoryRepo) Update(item *category.Item) error {
-	return nil
-}
-
-func (r *SqlCategoryRepo) Delete(params *category.DeleteParams) error {
-	return nil
-}
-
-func (r *SqlCategoryRepo) Find(params *category.FindParams) ([]*category.Item, error) {
-	return nil, nil
-}

+ 0 - 1
pkg/services/sqlstore/migrations/annotation_mig.go

@@ -35,7 +35,6 @@ func addAnnotationMig(mg *Migrator) {
 	}
 
 	mg.AddMigration("Drop old annotation table v4", NewDropTableMigration("annotation"))
-
 	mg.AddMigration("create annotation table v5", NewAddTableMigration(table))
 
 	// create indices

+ 0 - 27
pkg/services/sqlstore/migrations/category_mig.go

@@ -1,27 +0,0 @@
-package migrations
-
-import (
-	. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
-)
-
-func addAnnotationCategoryMig(mg *Migrator) {
-	category := Table{
-		Name: "category",
-		Columns: []*Column{
-			{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
-			{Name: "org_id", Type: DB_BigInt, Nullable: false},
-			{Name: "user_id", Type: DB_BigInt, Nullable: true},
-			{Name: "name", Type: DB_Text, Nullable: false},
-			{Name: "description", Type: DB_Text, Nullable: false},
-		},
-		Indices: []*Index{
-			{Cols: []string{"org_id", "name"}, Type: IndexType},
-		},
-	}
-
-	// create table
-	mg.AddMigration("create category table", NewAddTableMigration(category))
-
-	// create indices
-	mg.AddMigration("add index org_id & name", NewAddIndexMigration(category, category.Indices[0]))
-}

+ 0 - 1
pkg/services/sqlstore/migrations/migrations.go

@@ -26,7 +26,6 @@ func AddMigrations(mg *Migrator) {
 	addAnnotationMig(mg)
 	addStatsMigrations(mg)
 	addTestDataMigrations(mg)
-	// addAnnotationCategoryMig(mg)
 }
 
 func addMigrationLogMigrations(mg *Migrator) {

+ 0 - 3
pkg/services/sqlstore/sqlstore.go

@@ -12,7 +12,6 @@ import (
 	"github.com/grafana/grafana/pkg/log"
 	m "github.com/grafana/grafana/pkg/models"
 	"github.com/grafana/grafana/pkg/services/annotations"
-	"github.com/grafana/grafana/pkg/services/category"
 	"github.com/grafana/grafana/pkg/services/sqlstore/migrations"
 	"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
 	"github.com/grafana/grafana/pkg/setting"
@@ -101,8 +100,6 @@ func SetEngine(engine *xorm.Engine) (err error) {
 
 	// Init repo instances
 	annotations.SetRepository(&SqlAnnotationRepo{})
-	category.SetRepository(&SqlCategoryRepo{})
-
 	return nil
 }