added not null and foreign key constraints referencing deviceId and carrierId