tags:

views:

30

answers:

1

How do I alter column in sqlite? This is in Postgrsql

ALTER TABLE books_book ALTER COLUMN publication_date DROP NOT NULL;

I believe there is no ALTER COLUMN in sqlite at all, only ALTER TABLE is supported.

Any idea? Thanks!

+1  A: 

There's no ALTER COLUMN in sqlite.

I believe your only option is to:

  • Rename the table to a temporary name
  • Create a new table without the NOT NULL constraint
  • Copy the content of the old table to the new one
  • Remove the old table

This other Stackoverflow answer explains the process in details

Alexandre Jasmin
Thank you. It works. :)
JohnWong