I have a table in mysql
whose records can be created from different servers, these servers are configured as master and slave, and the id of each server was set to 1
, 2
, 3
e etc. I would like to know if it is possible to set the default value of a column to get the server_id
of the server that is inserting the record, something automatic type the auto increment.
I tried:
ALTER TABLE 'mytable'
ADD COLUMN 'somecolumn' TINYINT NULL DEFAULT server_id
But it does not work.