1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| use ta_BD;
drop procedure activation;
delimiter |
create procedure activation()
begin
declare t,v bool default 0;
select count(id)>0,state into t,v from config where module="nom_module";
if not v then
if t then
update config set state=1 where idmodule="nom_module";
else
insert into config(module,state)values("nom_module",1);
end if;
-- liste des create table pour ton module;
create table if not exists nom1(id int(4) not null auto_increment,primary key pk_nom1(id));
create table if not exists nom2(id int(4) not null auto_increment,primary key pk_nom2(id));
end if;
end|
delimiter ; |
Partager