change table structure logic