You can add a new column field under the admin_user core table using the db_schema.xml file for Magento 2.3 and the Higher version.
The client has a requirement like, store the current user location based on their geographical area.
you can add a new column in any table using a simple call existing table in the db_schema.xml file.
<?xml version="1.0"?> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd"> <table name="admin_user" resource="default" engine="innodb" comment="Admin User Table"> <column xsi:type="varchar" name="user_location" nullable="true" length="50" comment="User location"/> </table> </schema>
We have added new column user_location, which contains the location of specific admin users in the admin_user table.
Run command from Magento root instance to see change on the table,
php bin/magento setup:upgrade
Go to the database and check admin_user table to see the new column into the table.