Reported by digitaalinenhemuli on 2012-01-11 19:40:53
Thanks for reporting this. Changing primary key is just not supported at the moment,
as SQLite does not support the ALTER TABLE statement to do so.
You can add a UNIQUE index (do not allow duplicates), but you cannot remove the existing
primary key (at the moment).
I can think of 2 possible solutions to implement this:
1. Remove primary key and add a unique key on the new column
(I am not sure SQLite allows us to remove the primary key, though).
2. Recreate the table, as we do when renaming columns/types etc. Relates to issue #12
Reported by `crazy4chrissi` on 2012-06-02 20:38:10
- Labels added: Type-Enhancement
- Labels removed: Type-Defect
I think I'll implement this for 1.9.4 in my alter table function.Not that difficult I'd say.
Reported by crazy4chrissi on 2012-10-30 22:37:38
Reported by crazy4chrissi on 2012-10-30 22:37:48
- Status changed: Accepted
Reported by crazy4chrissi on 2013-12-23 23:00:24
- Labels added: Target-1.9.5
With r444, it is now possible to add primary keys (only if the table has no primarykey yet). But it is not yet possible to change or drop them.
Reported by crazy4chrissi on 2013-12-29 23:01:54
Reported by crazy4chrissi on 2013-12-29 23:19:12
Dropping primary keys is missing. Once this is done, changing is only dropping the oldone and creating the new one (which is now possible), so this is easy then.
Reported by crazy4chrissi on 2013-12-29 23:20:55
Reported by crazy4chrissi on 2014-01-02 12:40:21
- Labels added: Target-1.9.6
- Labels removed: Target-1.9.5