CREATE TABLE IF NOT EXISTS vehicle_makes (
    id SERIAL,
    name varchar(100) NOT NULL,
    tenant_id INTEGER DEFAULT NULL,
    branch_id INTEGER DEFAULT NULL,
    isDeleted BOOLEAN NOT NULL DEFAULT FALSE,
    updatedAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (id)
);
CREATE INDEX IF NOT EXISTS vehicle_makes_tenant_idx ON vehicle_makes(tenant_id);
CREATE INDEX IF NOT EXISTS vehicle_makes_branch_idx ON vehicle_makes(branch_id);

CREATE TABLE IF NOT EXISTS vehicle_models (
    id SERIAL,
    make_id INTEGER DEFAULT NULL,
    name varchar(100) NOT NULL,
    tenant_id INTEGER DEFAULT NULL,
    branch_id INTEGER DEFAULT NULL,
    isDeleted BOOLEAN NOT NULL DEFAULT FALSE,
    updatedAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (id)
);
CREATE INDEX IF NOT EXISTS vehicle_models_make_idx ON vehicle_models(make_id);
CREATE INDEX IF NOT EXISTS vehicle_models_tenant_idx ON vehicle_models(tenant_id);
CREATE INDEX IF NOT EXISTS vehicle_models_branch_idx ON vehicle_models(branch_id);
