First, DDL Compatibility Specification (prevent the table structure changes, the original SQL execution error)
You can only add fields or modify field lengths (field lengths are larger), cannot modify field names and types, and cannot delete fields
cannot delete table or modify table name
ii. DML Compatibility Specification
INSERT statement needs to specify column, INSERT INTO table_name (column 1, column 2,...) Values (value 1, value 2,....)
the meaning of a field can only be expanded and not modified and reduced, and, if modified and reduced, must be replaced with a new field
Example One: For example, the sex field has two values: 0 for Male 1 for female, to swap these two values is not allowed:
update t1 Set sex = 2 where sex = 1;
update t1 Set sex = 1 where sex = 0;
update t1 Set sex = 0 where sex = 2;
because old code also think 0 is male 1 is female, and new code thinks 0 is female 1 is male;
Example Two: For example, the Sex field has 3 values: 0 for the male 1 for the female 2 for the unknown, the code inside the unknown before the judgment, if it is unknown, will do some things, but the other developers because of poor consideration, directly in the database to change all 2 value to 0 or 1, That could result in an older version of the code running incorrectly.
third, DQL compatibility specification
Disable SELECT *, you must specify a column
SQL Statement Compatibility specification