Modify a Column's Type in sqlite3

前端 未结 4 1703
日久生厌
日久生厌 2020-11-29 01:13

I\'m pretty new to SQLite 3 and just now I had to add a column to an existing table I had. I went about doing that by doing: ALTER TABLE thetable ADD COLUMN category;<

4条回答
  •  清酒与你
    2020-11-29 02:05

    If you prefer a GUI, DB Browser for SQLite will do this with a few clicks.

    1. "File" - "Open Database"
    2. In the "Database Structure" tab, click on the table content (not table name), then "Edit" menu, "Modify table", and now you can change the data type of any column with a drop down menu. I changed a 'text' field to 'numeric' in order to retrieve data in a number range.

    DB Browser for SQLite is open source and free. For Linux it is available from the repository.

提交回复
热议问题