|
539 | 539 | begin_area TEXT, |
540 | 540 | end_area TEXT, |
541 | 541 | disambiguation TEXT, |
542 | | - discogs_artist_id INTEGER, |
| 542 | + discogs_artist_id BIGINT, |
543 | 543 | aliases JSONB, |
544 | 544 | tags JSONB, |
545 | 545 | data JSONB, |
|
559 | 559 | ended BOOLEAN DEFAULT FALSE, |
560 | 560 | area TEXT, |
561 | 561 | disambiguation TEXT, |
562 | | - discogs_label_id INTEGER, |
| 562 | + discogs_label_id BIGINT, |
563 | 563 | data JSONB, |
564 | 564 | created_at TIMESTAMPTZ DEFAULT NOW(), |
565 | 565 | updated_at TIMESTAMPTZ DEFAULT NOW() |
|
573 | 573 | barcode TEXT, |
574 | 574 | status TEXT, |
575 | 575 | release_group_mbid UUID, |
576 | | - discogs_release_id INTEGER, |
| 576 | + discogs_release_id BIGINT, |
577 | 577 | data JSONB, |
578 | 578 | created_at TIMESTAMPTZ DEFAULT NOW(), |
579 | 579 | updated_at TIMESTAMPTZ DEFAULT NOW() |
|
588 | 588 | secondary_types JSONB, |
589 | 589 | first_release_date TEXT, |
590 | 590 | disambiguation TEXT, |
591 | | - discogs_master_id INTEGER, |
| 591 | + discogs_master_id BIGINT, |
592 | 592 | data JSONB, |
593 | 593 | created_at TIMESTAMPTZ DEFAULT NOW(), |
594 | 594 | updated_at TIMESTAMPTZ DEFAULT NOW() |
|
623 | 623 | UNIQUE (mbid, entity_type, service_name, url) |
624 | 624 | )""", |
625 | 625 | ), |
| 626 | + # Widen Discogs cross-reference IDs from INTEGER (int4, max 2,147,483,647) |
| 627 | + # to BIGINT. Discogs IDs are emitted as i64 by the extractor and release IDs |
| 628 | + # now exceed 2.1B, causing "integer out of range" on INSERT. CREATE TABLE |
| 629 | + # IF NOT EXISTS above won't alter pre-existing tables, so widen explicitly. |
| 630 | + # ALTER COLUMN ... TYPE BIGINT is a no-op when the column is already BIGINT. |
| 631 | + ( |
| 632 | + "musicbrainz.artists.discogs_artist_id widen to BIGINT", |
| 633 | + "ALTER TABLE musicbrainz.artists ALTER COLUMN discogs_artist_id TYPE BIGINT", |
| 634 | + ), |
| 635 | + ( |
| 636 | + "musicbrainz.labels.discogs_label_id widen to BIGINT", |
| 637 | + "ALTER TABLE musicbrainz.labels ALTER COLUMN discogs_label_id TYPE BIGINT", |
| 638 | + ), |
| 639 | + ( |
| 640 | + "musicbrainz.releases.discogs_release_id widen to BIGINT", |
| 641 | + "ALTER TABLE musicbrainz.releases ALTER COLUMN discogs_release_id TYPE BIGINT", |
| 642 | + ), |
| 643 | + ( |
| 644 | + "musicbrainz.release_groups.discogs_master_id widen to BIGINT", |
| 645 | + "ALTER TABLE musicbrainz.release_groups ALTER COLUMN discogs_master_id TYPE BIGINT", |
| 646 | + ), |
626 | 647 | ] |
627 | 648 |
|
628 | 649 |
|
|
0 commit comments