Skip to content

Commit e8f9c0c

Browse files
committed
Add primary key for chairs table.
Update FK values in id_internal, area_directors, groups_ietf Update none_wg_mailing_list - Legacy-Id: 287
1 parent 3811dcf commit e8f9c0c

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

test/sql_fixup.sql

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,54 @@ ALTER TABLE `ballots_discuss` ADD UNIQUE (`ballot_id` , `ad_id`);
1717
ALTER TABLE `iesg_history` DROP PRIMARY KEY;
1818
ALTER TABLE `iesg_history` ADD `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ;
1919

20+
ALTER TABLE `chairs` DROP PRIMARY KEY;
21+
ALTER TABLE `chairs` ADD `id` INT NOT NULL AUTO_INCREMENT
22+
PRIMARY KEY FIRST ;
23+
24+
2025
INSERT INTO announced_from VALUES (98, 'IETF Executive Director <exec-director@ietf.org>', NULL);
2126
INSERT INTO announced_to VALUES (9, 'Unknown', NULL);
2227
INSERT INTO area_status VALUES (3, 'Unknown');
2328

29+
--
30+
-- Date-based views require all dates to be reasonable.
31+
-- These two rows had bad dates.
2432
UPDATE ipr_detail SET submitted_date="2000-09-15" WHERE ipr_id=170;
2533
UPDATE ipr_detail SET submitted_date="2004-08-30" WHERE ipr_id=418;
2634

35+
--
36+
-- ref_doc_states_new had UTF-8 in the document_desc.
2737
UPDATE ref_doc_states_new SET document_desc='A formal request has been made to advance/publish the document, following the procedures in Section 7.5 of RFC 2418. The request could be from a WG chair, from an individual through the RFC Editor, etc. (The Secretariat (iesg-secretary@ietf.org) is copied on these requests to ensure that the request makes it into the ID tracker.) A document in this state has not (yet) been reviewed by an AD nor has any official action been taken on it yet (other than to note that its publication has been requested.' WHERE document_state_id=10;
2838

39+
--
40+
--
41+
-- django wants FK pointers to nowhere to be NULL;
42+
-- the current schema uses pointers to nonexistent rows.
43+
ALTER TABLE `id_internal`
44+
CHANGE `cur_sub_state_id` `cur_sub_state_id` INT( 11 ) NULL DEFAULT NULL,
45+
CHANGE `prev_sub_state_id` `prev_sub_state_id` INT( 11 ) NULL DEFAULT NULL;
46+
47+
UPDATE id_internal SET cur_sub_state_id=NULL WHERE cur_sub_state_id < 1;
48+
UPDATE id_internal SET prev_sub_state_id=NULL WHERE prev_sub_state_id < 1;
49+
50+
-- need to do announcements (99998 and 0 for person_or_org_tag)
51+
52+
UPDATE imported_mailing_list SET group_acronym_id=NULL WHERE group_acronym_id=0;
53+
54+
ALTER TABLE `area_directors`
55+
CHANGE `area_acronym_id` `area_acronym_id` INT(11) NULL DEFAULT NULL;
56+
57+
UPDATE area_directors SET area_acronym_id=NULL WHERE area_acronym_id=999999;
58+
59+
ALTER TABLE `groups_ietf`
60+
CHANGE `area_director_id` `area_director_id` INT(11) NULL DEFAULT NULL;
61+
62+
UPDATE groups_ietf SET area_director_id=NULL WHERE area_director_id=0;
63+
-- inactive groups are at risk of having their area_director rows
64+
-- deleted, so orphaned. should we fix all of these to NULL?
65+
66+
67+
-- the only missing area is for a sub-ip mailing list, so instead of
68+
-- making the model say that the area is optional, set it here.
69+
UPDATE none_wg_mailing_list SET area_acronym_id=1541 WHERE id=45;
70+

0 commit comments

Comments
 (0)