()
| 259 | } |
| 260 | |
| 261 | func (s *sqlDatabase) cascadeMigration() error { |
| 262 | switch s.cfg.DbBackend { |
| 263 | case config.SQLiteBackend: |
| 264 | if err := s.cascadeMigrationSQLite(&Address{}, "addresses", true); err != nil { |
| 265 | return fmt.Errorf("failed to drop table addresses: %w", err) |
| 266 | } |
| 267 | |
| 268 | if err := s.cascadeMigrationSQLite(&InstanceStatusUpdate{}, "instance_status_updates", true); err != nil { |
| 269 | return fmt.Errorf("failed to drop table instance_status_updates: %w", err) |
| 270 | } |
| 271 | |
| 272 | if err := s.cascadeMigrationSQLite(&Tag{}, "pool_tags", false); err != nil { |
| 273 | return fmt.Errorf("failed to migrate addresses: %w", err) |
| 274 | } |
| 275 | |
| 276 | if err := s.cascadeMigrationSQLite(&WorkflowJob{}, "workflow_jobs", false); err != nil { |
| 277 | return fmt.Errorf("failed to migrate addresses: %w", err) |
| 278 | } |
| 279 | case config.MySQLBackend: |
| 280 | return nil |
| 281 | default: |
| 282 | return fmt.Errorf("invalid db backend: %s", s.cfg.DbBackend) |
| 283 | } |
| 284 | return nil |
| 285 | } |
| 286 | |
| 287 | func (s *sqlDatabase) ensureGithubEndpoint() error { |
| 288 | // Create the default Github endpoint. |
no test coverage detected