Projet

Général

Profil

US #962 » company-country.sql

ahlem belgacem, 21/02/2025 14:32

 
1

    
2
use  socle;
3
alter table company drop column countryCode;
4
CREATE TABLE company_country (
5
    id INT AUTO_INCREMENT PRIMARY KEY,
6
    companyId INT NOT NULL,
7
    countryCode VARCHAR(255) NOT NULL,
8
    FOREIGN KEY (companyId) REFERENCES company(id) ON DELETE CASCADE ON UPDATE CASCADE,
9
    FOREIGN KEY (countryCode) REFERENCES solution_setting_country(code) ON DELETE CASCADE ON UPDATE CASCADE,
10
    UNIQUE (companyId, countryCode)
11
);
12
-- add to the first company solution countries and cities
    (1-1/1)