/**
 * @author Emmanuel BONNEAU
 * @date 23/02/21
 * @version 1.0.0
 * @project SIEau
 * @table mat_types
 */

# --- !Ups

insert into mat_types (champ, type, libelle, datemaj, loginmaj) VALUES ('MAT_TELECOM.TYPE', 1, 'GSM-SMS', '2021-02-23 11:00:00', 'ebonneau');
insert into mat_types (champ, type, libelle, datemaj, loginmaj) VALUES ('MAT_TELECOM.TYPE', 2, 'GPRS', '2021-02-23 11:00:00', 'ebonneau');
insert into mat_types (champ, type, libelle, datemaj, loginmaj) VALUES ('MAT_TELECOM.TYPE', 3, 'RTC', '2021-02-23 11:00:00', 'ebonneau');
insert into mat_types (champ, type, libelle, datemaj, loginmaj) VALUES ('MAT_TELECOM.TYPE', 4, 'Satellite', '2021-02-23 11:00:00', 'ebonneau');
insert into mat_types (champ, type, libelle, datemaj, loginmaj) VALUES ('MAT_TELECOM.TYPE', 5, 'GPRS-SMS', '2021-02-23 11:00:00', 'ebonneau');
insert into mat_types (champ, type, libelle, datemaj, loginmaj) VALUES ('MAT_TELECOM.TYPE', 6, 'IOT', '2021-02-23 11:00:00', 'ebonneau');
insert into mat_types (champ, type, libelle, datemaj, loginmaj) VALUES ('MAT_TELECOM.TYPE', 7, 'Ligne Numérique/Box', '2021-02-23 11:00:00', 'ebonneau');

update mat_types set libelle = 'Ligne Numérique/Box' where champ = 'MAT_ABONNEMENT.TYPE' and type = 4;
update mat_types set libelle = 'Satellite' where champ = 'MAT_ABONNEMENT.TYPE' and type = 5;

delete from mat_types where champ like 'MAT_SITUATIONS.CODEETAT' and type = 5;

# --- !Downs

delete from mat_types where champ = 'MAT_TELECOM.TYPE' and type = 1;
delete from mat_types where champ = 'MAT_TELECOM.TYPE' and type = 2;
delete from mat_types where champ = 'MAT_TELECOM.TYPE' and type = 3;
delete from mat_types where champ = 'MAT_TELECOM.TYPE' and type = 4;
delete from mat_types where champ = 'MAT_TELECOM.TYPE' and type = 5;
delete from mat_types where champ = 'MAT_TELECOM.TYPE' and type = 6;
delete from mat_types where champ = 'MAT_TELECOM.TYPE' and type = 7;

update mat_types set libelle = 'GSM' where champ = 'MAT_ABONNEMENT.TYPE' and type = 4;
update mat_types set libelle = 'GPRS' where champ = 'MAT_ABONNEMENT.TYPE' and type = 5;

insert into mat_types(champ, type, libelle) VALUES ('MAT_SITUATIONS.CODEETAT', 5, 'Affectation provisoire');