samedi 5 décembre 2015

SQLITE loosening or eliminating enum constraint

Am reading that altering table constraints for SQLITE is limited, but hoping there is a way I missed to either add a new choice to an enumerated type of constraint, or to drop the constraint altogether.

For example say I wanted to add a "GOLDFISH" to a Pet table created like this:

CREATE TABLE "Pet" (
    name VARCHAR NOT NULL,
    species VARCHAR,
    CHECK (species IN ('DOG', "CAT")),
)

Is there a way I can alter the table to make it legal to do so short of creating a new table and transfering the data?

Aucun commentaire:

Enregistrer un commentaire