[Django]-Sqlite3 Adding Columns

3👍

You can ALTER TABLE to add a new column in Sqlite3 but not rename it nor drop it. Sqlite3 is a very useful database for bootstrapping your app. But sooner or later, you will need to change to a more robust/flexible database engine, say MySql or Postgresql.

Every time you add a new column to your models using Sqlite, you will need to recreate the schema (as far as I know, when you do migrations with Sqlite to add new columns, south complaints. see below). An approach I like more is use MySql with Django-South from the beginning, where I’m not sure about every aspect of my database.

Django South is an app for doing database migrations. It’s very useful and the docs are a good starting point for beginners.

Every time you should make modifications to your database, you should consider them as migrations and use South.

Hope this helps!

Leave a comment