determines whether the field exists, and if so, does not change it.
if the field does not exist, execute the new field source
the default value is null
, and the existing field source
is set to 0
IF NOT EXITS (SELECT * FROM information_schema.columns where table_schema = DATABASE() AND table_name = "file" AND column_name = "source") THEN
Alter table file add source varchar(20);
Update file set source = "0";
END IF;