void checkAddColumn ( ColumnSchema col ) { if ( table . isText ( ) && ! table . isEmpty ( session ) ) { throw Error . error ( ErrorCode . X_S0521 ) ; } if ( table . findColumn ( col . getName ( ) . name ) != - 1 ) { throw Error . error ( ErrorCode . X_42504 ) ; } if ( col . isPrimaryKey ( ) && table . hasPrimaryKey ( ) ) { throw Error . error ( ErrorCode . X_42530 ) ; } if ( col . isIdentity ( ) && table . hasIdentityColumn ( ) ) { throw Error . error ( ErrorCode . X_42525 ) ; } if ( ! table . isEmpty ( session ) && ! col . hasDefault ( ) && ( ! col . isNullable ( ) || col . isPrimaryKey ( ) ) && ! col . isIdentity ( ) ) { throw Error . error ( ErrorCode . X_42531 ) ; } }
Checks if the attributes of the Column argument c are compatible with the operation of adding such a Column to the Table argument table .