
CREATE TABLE ppl2grp_new (
	ppl2grp_id INTEGER PRIMARY KEY AUTO_INCREMENT,
	ppl_id INTEGER NOT NULL,
	grp_id INTEGER NOT NULL,
	ppl_enter INTEGER NOT NULL, -- seconds since epoch
	ppl_exit INTEGER NOT NULL -- seconds since epoch
);
CREATE INDEX ppl2grp0_new ON ppl2grp_new ( ppl_id );
CREATE INDEX ppl2grp1_new ON ppl2grp_new ( grp_id );

INSERT INTO ppl2grp_new ( ppl_id, grp_id, ppl_enter, ppl_exit ) SELECT ppl_id, grp_id, ppl_enter, ppl_exit FROM ppl2grp
