create table tab1 (
    t1id int unsigned not null auto_increment,
    t1val varchar(30) not null,
    constraint pkt1 primary key (t1id)
);
create table tab2 (
    t2id int unsigned not null auto_increment,
    t1id int unsigned,
    t2tval datetime,
    t2nval int,
    constraint pkt2 primary key (t2id)
);
alter table tab2 add index FkIdxt2t1id (t1id), add constraint Fkt2t1id foreign key (t1id) references tab1 (t1id);

alter table tab2 modify t1id int unsigned not null, modify t2tval timestamp(3), modify t2nval bigint;
