Skip to content

Commit

Permalink
DEV-1449: schema updates for holdings/hathifile loading
Browse files Browse the repository at this point in the history
* ocn uses bigint -- while the maximum real OCN fits comfortably in 32
  bits, it's possible we'll have other non-OCN numbers come through, and
  validation practices differ across different things (hathifiles,
  holdings, etc)

* index ocn and organization for holdings
  • Loading branch information
aelkiss committed Feb 5, 2025
1 parent ffa943d commit c892b56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sql/005_cluster_ocns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ USE `ht_repository`;

DROP TABLE IF EXISTS `cluster_ocns`;
CREATE TABLE `cluster_ocns` (
cluster_id int NOT NULL,
ocn int NOT NULL,
cluster_id int unsigned NOT NULL,
ocn bigint unsigned NOT NULL,
PRIMARY KEY (ocn),
INDEX (cluster_id)
) ENGINE=InnoDB;
Expand Down
3 changes: 3 additions & 0 deletions sql/006_holdings.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ CREATE TABLE `holdings` (
`date_received` date NOT NULL,
`uuid` char(36) NOT NULL,
`issn` varchar(255) NULL

KEY (`ocn`),
KEY (`organization`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
4 changes: 2 additions & 2 deletions sql/007_oclc_concordance.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use `ht_repository`;

DROP TABLE IF EXISTS `oclc_concordance`;
CREATE TABLE `oclc_concordance` (
`oclc` int(10) unsigned NOT NULL,
`canonical` int(10) unsigned DEFAULT NULL,
`oclc` bigint unsigned NOT NULL,
`canonical` bigint unsigned DEFAULT NULL,
PRIMARY KEY (`oclc`,`canonical`),
INDEX (`canonical`)
) ENGINE=InnoDB

0 comments on commit c892b56

Please sign in to comment.