(t *testing.T)
| 353 | } |
| 354 | |
| 355 | func TestComputeDiff_DropTable_Destructive(t *testing.T) { |
| 356 | current := &sdata.DBInfo{ |
| 357 | Type: "postgres", |
| 358 | Tables: []sdata.DBTable{ |
| 359 | { |
| 360 | Name: "old_table", |
| 361 | Columns: []sdata.DBColumn{ |
| 362 | {Name: "id", Type: "bigint", PrimaryKey: true}, |
| 363 | }, |
| 364 | }, |
| 365 | }, |
| 366 | } |
| 367 | |
| 368 | expected := &sdata.DBInfo{ |
| 369 | Type: "postgres", |
| 370 | Tables: []sdata.DBTable{}, |
| 371 | } |
| 372 | |
| 373 | // With destructive flag |
| 374 | ops := computeDiff(current, expected, DiffOptions{Destructive: true}) |
| 375 | |
| 376 | found := false |
| 377 | for _, op := range ops { |
| 378 | if op.Type == "drop_table" && op.Table == "old_table" { |
| 379 | found = true |
| 380 | if !op.Danger { |
| 381 | t.Error("drop_table operation should be marked as dangerous") |
| 382 | } |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | if !found { |
| 387 | t.Error("expected drop_table operation when destructive is true") |
| 388 | } |
| 389 | } |
| 390 | |
| 391 | func TestPostgresDialect_MapType(t *testing.T) { |
| 392 | d := &postgresDialect{} |
nothing calls this directly
no test coverage detected