Skip to content

Commit

Permalink
Evarisk#268 [SQL] clean: sql files
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Jul 17, 2024
1 parent b40126f commit e9fd20b
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 94 deletions.
19 changes: 6 additions & 13 deletions sql/llx_dolicar_registrationcertificatefr.key.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Copyright (C) ---Put here your own copyright and developer email---
-- Copyright (C) 2022-2024 EVARISK <[email protected]>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand All @@ -13,19 +13,12 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see https://www.gnu.org/licenses/.


-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_dolicar_registrationcertificatefr ADD INDEX idx_dolicar_registrationcertificatefr_rowid (rowid);
ALTER TABLE llx_dolicar_registrationcertificatefr ADD INDEX idx_dolicar_registrationcertificatefr_ref (ref);
ALTER TABLE llx_dolicar_registrationcertificatefr ADD INDEX idx_dolicar_registrationcertificatefr_fk_soc (fk_soc);
ALTER TABLE llx_dolicar_registrationcertificatefr ADD INDEX idx_dolicar_registrationcertificatefr_status (status);
ALTER TABLE llx_dolicar_registrationcertificatefr ADD INDEX idx_dolicar_registrationcertificatefr_fk_project (fk_project);
ALTER TABLE llx_dolicar_registrationcertificatefr ADD INDEX idx_dolicar_registrationcertificatefr_fk_product (fk_product);
ALTER TABLE llx_dolicar_registrationcertificatefr ADD INDEX idx_dolicar_registrationcertificatefr_fk_lot (fk_lot);
ALTER TABLE llx_dolicar_registrationcertificatefr ADD UNIQUE uk_registrationcertificate_ref (ref, entity);

-- END MODULEBUILDER INDEXES

--ALTER TABLE llx_dolicar_registrationcertificatefr ADD UNIQUE INDEX uk_dolicar_registrationcertificatefr_fieldxy(fieldx, fieldy);

--ALTER TABLE llx_dolicar_registrationcertificatefr ADD CONSTRAINT llx_dolicar_registrationcertificatefr_fk_field FOREIGN KEY (fk_field) REFERENCES llx_dolicar_myotherobject(rowid);

ALTER TABLE llx_dolicar_registrationcertificatefr ADD INDEX idx_dolicar_registrationcertificatefr_fk_soc (fk_soc);
ALTER TABLE llx_dolicar_registrationcertificatefr ADD INDEX idx_dolicar_registrationcertificatefr_fk_project (fk_project);
ALTER TABLE llx_dolicar_registrationcertificatefr ADD UNIQUE INDEX uk_registrationcertificate_ref (ref, entity);
ALTER TABLE llx_dolicar_registrationcertificatefr ADD CONSTRAINT llx_dolicar_registrationcertificatefr_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
126 changes: 62 additions & 64 deletions sql/llx_dolicar_registrationcertificatefr.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Copyright (C) ---Put here your own copyright and developer email---
-- Copyright (C) 2022-2024 EVARISK <[email protected]>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
Expand All @@ -15,67 +15,65 @@


CREATE TABLE llx_dolicar_registrationcertificatefr(
-- BEGIN MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
ref varchar(128) NOT NULL,
fk_soc integer,
date_creation datetime NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_user_creat integer NOT NULL,
fk_user_modif integer,
entity integer DEFAULT 1,
import_key varchar(14),
status integer NOT NULL DEFAULT 1,
ref_ext varchar(128),
a_registration_number varchar(128) NOT NULL,
b_first_registration_date datetime,
c1_owner_fullname varchar(255),
c3_registration_address text,
c4a_vehicle_owner boolean,
c41_second_owner_number integer,
c41_second_owner_name varchar(128),
d1_vehicle_brand varchar(128),
d2_vehicle_type varchar(128),
d21_vehicle_cnit varchar(128),
d3_vehicle_model varchar(128),
e_vehicle_serial_number varchar(128),
f1_technical_ptac integer,
f2_ptac integer,
f3_ptra integer,
g_vehicle_weight integer,
g1_vehicle_empty_weight integer,
h_validity_period varchar(128),
i_vehicle_registration_date datetime,
j_vehicle_category varchar(128),
j1_national_type varchar(128),
j2_european_bodywork varchar(128),
j3_national_bodywork varchar(128),
k_type_approval_number varchar(128),
p1_cylinder_capacity integer,
p2_maximum_net_power integer,
p3_fuel_type varchar(128),
p6_national_administrative_power integer,
q_power_to_weight_ratio integer,
s1_seating_capacity integer,
s2_standing_capacity integer,
u1_stationary_noise_level integer,
u2_motor_speed integer,
v7_co2_emission integer,
v9_environmental_category varchar(128),
x1_first_technical_inspection_date datetime,
y1_regional_tax double(24,8),
y2_professional_tax double(24,8),
y3_ecological_tax double(24,8),
y4_management_tax double(24,8),
y5_forwarding_expenses_tax double(24,8),
y6_total_price_vehicle_registration double(24,8),
z1_specific_details text,
z2_specific_details text,
z3_specific_details text,
z4_specific_details text,
fk_product integer,
fk_project integer,
fk_lot integer,
json longtext
-- END MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
ref varchar(128) NOT NULL,
ref_ext varchar(128),
entity integer DEFAULT 1 NOT NULL,
date_creation datetime NOT NULL,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
import_key varchar(14),
status integer NOT NULL DEFAULT 1,
a_registration_number varchar(128) NOT NULL,
b_first_registration_date datetime,
c1_owner_fullname varchar(255),
c3_registration_address text,
c4a_vehicle_owner boolean,
c41_second_owner_number integer,
c41_second_owner_name varchar(128),
d1_vehicle_brand varchar(128),
d2_vehicle_type varchar(128),
d21_vehicle_cnit varchar(128),
d3_vehicle_model varchar(128),
e_vehicle_serial_number varchar(128),
f1_technical_ptac integer,
f2_ptac integer,
f3_ptra integer,
g_vehicle_weight integer,
g1_vehicle_empty_weight integer,
h_validity_period varchar(128),
i_vehicle_registration_date datetime,
j_vehicle_category varchar(128),
j1_national_type varchar(128),
j2_european_bodywork varchar(128),
j3_national_bodywork varchar(128),
k_type_approval_number varchar(128),
p1_cylinder_capacity integer,
p2_maximum_net_power integer,
p3_fuel_type varchar(128),
p6_national_administrative_power integer,
q_power_to_weight_ratio integer,
s1_seating_capacity integer,
s2_standing_capacity integer,
u1_stationary_noise_level integer,
u2_motor_speed integer,
v7_co2_emission integer,
v9_environmental_category varchar(128),
x1_first_technical_inspection_date datetime,
y1_regional_tax double(24,8),
y2_professional_tax double(24,8),
y3_ecological_tax double(24,8),
y4_management_tax double(24,8),
y5_forwarding_expenses_tax double(24,8),
y6_total_price_vehicle_registration double(24,8),
z1_specific_details text,
z2_specific_details text,
z3_specific_details text,
z4_specific_details text,
json longtext,
fk_product integer,
fk_lot integer,
fk_soc integer,
fk_project integer,
fk_user_creat integer NOT NULL,
fk_user_modif integer
) ENGINE=innodb;
12 changes: 5 additions & 7 deletions sql/llx_dolicar_registrationcertificatefr_extrafields.key.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- Copyright (C) ---Put here your own copyright and developer email---
-- Copyright (C) 2022-2024 EVARISK <[email protected]>
--
-- This program is free software; you can redistribute it and/or modify
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
Expand All @@ -11,9 +11,7 @@
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see https://www.gnu.org/licenses/.
-- along with this program. If not, see https://www.gnu.org/licenses/.


-- BEGIN MODULEBUILDER INDEXES
ALTER TABLE llx_dolicar_registrationcertificatefr_extrafields ADD INDEX idx_registrationcertificatefr_rowid (rowid);
ALTER TABLE llx_dolicar_registrationcertificatefr_extrafields ADD INDEX idx_registrationcertificatefr_fk_object(fk_object);
-- END MODULEBUILDER INDEXES
19 changes: 9 additions & 10 deletions sql/llx_dolicar_registrationcertificatefr_extrafields.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- Copyright (C) ---Put here your own copyright and developer email---
-- Copyright (C) 2022-2024 EVARISK <[email protected]>
--
-- This program is free software; you can redistribute it and/or modify
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
Expand All @@ -11,13 +11,12 @@
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see https://www.gnu.org/licenses/.
-- along with this program. If not, see https://www.gnu.org/licenses/.

create table llx_dolicar_registrationcertificatefr_extrafields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14) -- import key
create table llx_dolicar_registrationcertificatefr_extrafields(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_object integer NOT NULL,
import_key varchar(14)
) ENGINE=innodb;

15 changes: 15 additions & 0 deletions sql/update.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
-- Copyright (C) 2022-2024 EVARISK <[email protected]>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see https://www.gnu.org/licenses/.

ALTER TABLE `llx_dolicar_registrationcertificatefr` ADD `fk_product` integer NOT NULL AFTER `z4_specific_details`;
ALTER TABLE `llx_dolicar_registrationcertificatefr` DROP `d3_vehicle_model`;
ALTER TABLE `llx_dolicar_registrationcertificatefr` ADD `d3_vehicle_model` varchar(128) NULL AFTER `d21_vehicle_cnit`;
Expand Down

0 comments on commit e9fd20b

Please sign in to comment.