Skip to content

Commit

Permalink
migration - drop events system
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Gahlot <[email protected]>
  • Loading branch information
gauravgahlot committed Mar 26, 2021
1 parent 24b622f commit ea5ece4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions db/migration/2021032610300-drop-events-system.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package migration

import migrate "github.com/rubenv/sql-migrate"

// Get202103261030 removes the event system tables and triggers.
//
// Fixes: https://github.com/tinkerbell/tink/issues/464
//
// The event system in place relies on triggers.
// It causes many problems because of its 8k characters limitation.
// CAPT is suffering from this limitation.
func Get2021032610300() *migrate.Migration {
return &migrate.Migration{
Id: "2021032610300-drop-events-system",
Up: []string{`
DROP TABLE IF EXISTS events CASCADE;
DROP TRIGGER IF EXISTS events_channel ON events;
DROP TRIGGER IF EXISTS hardware_event_trigger ON hardware;
DROP TRIGGER IF EXISTS template_event_trigger ON template;
DROP TRIGGER IF EXISTS workflow_event_trigger ON workflow;
DROP TYPE IF EXISTS resource_type;
DROP TYPE IF EXISTS event_type;
`},
}
}
1 change: 1 addition & 0 deletions db/migration/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var migrations = []func() *migrate.Migration{
Get202012041103,
Get202012091055,
Get2020121691335,
Get2021032610300,
}

func GetMigrations() *migrate.MemoryMigrationSource {
Expand Down

0 comments on commit ea5ece4

Please sign in to comment.