How to change database schema

I am using an outdated version of sqlite to develop my application.

For some problem, I changed one of the tables to add a new column. Previously, this table data is stored in integers, after changing the table, which they changed to rows. How can I get the modified string data again with integers, and also ask how to request these fields?

+4
source share
2 answers

SQLite allows very limited changes to an existing table . For something else:

  • rename the old table,
  • create a new table with the old name and with the correct column definitions,
  • copy data and
  • delete the old table.

Do it in one transaction, of course! Also, practice a different database before trying to use it with your production data.

+7
source

Connect to your SQL Lite database from Visual Studio Server Explorer and make schema changes. When you right-click on the table you want to make changes to, there is an editing option.

0
source

Source: https://habr.com/ru/post/1381069/


All Articles