I have created a custom column named 'campaign_id' through UpgradeSchema in quote table as below.
$installer->getConnection()->addColumn( $installer->getTable('quote'), 'campaign_id', [ 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, 'length' => 11, 'nullable' => false, 'comment' => 'Campaign ID' ] );
I am setting its value through custom controller on add to cart as below
// \Magento\Checkout\Model\Session $this->checkoutSession->getQuote() ->setCampaignId($campaign_id) ->save();
The value is getting saved properly when I'm adding product as a guest user or as a logged in user.
However when I add the product as a guest user and then log in, the custom quote column value from guest quote is not getting copied to customer quote on quote merge.