Objection to the above two answers, I just encountered this problem. Drop is not supported in sqlite's alter. That is to say, columns cannot be deleted directly. If you must implement this function, you can only create a new table for the time being, then migrate the things in the previous table, delete the old table, and then change the name of the new table to the name of the old table. This is what I learned. . . Hopefully there's a better way. . .
alter table tableName drop column columnName . Normal SQL operations
I haven’t learned database before, buddy.
Objection to the above two answers, I just encountered this problem. Drop is not supported in sqlite's alter.
That is to say, columns cannot be deleted directly.
If you must implement this function, you can only create a new table for the time being, then migrate the things in the previous table, delete the old table, and then change the name of the new table to the name of the old table.
This is what I learned. . . Hopefully there's a better way. . .