You can deploy more than one smart contract from a single migration file. Truffle migrations are exactly made for linking contracts, libraries, passing arguments.
If you only wish to deploy two independent contracts:
const Contract1 = artifacts.require("Contract1");
const Contract2 = artifacts.require("Contract2");
module.exports = function(deployer){
deployer.deploy(Contract1);
deployer.deploy(Contract2);
}
When your contracts don't need to interact, having different migration files for each one is useful. If you made changes to only one of them, you can separately run that specific migration, avoiding redeploying unchanged code: truffle migrate -f x --to x
(where x is the prefix of your migration file number).
Although, if your contracts depend on each other, you are dealing with a bit more complexity. My post explains it in more detail: https://blockheroes.dev/complex-migration/. For example, if Contract1 needs a reference to Contract2:
const Contract1 = artifacts.require("Contract1");
const Contract2 = artifacts.require("Contract2");
module.exports = function (deployer) {
// deploy Contract2 first
deployer.deploy(Contract2).then(async () => {
// get JS instance of deployed contract
const c2instance = await Contract2.deployed();
// pass its address as argument for Contract1's constructor
await deployer.deploy(Contract1, c2instance.address);
});
};