#1 2018-02-11 18:54:09

vlad
Member
Registered: 2017-03-20
Posts: 16

Remove "stored AS_UNIQUE" attribute

Hello,

One of my TSQLRecord classes had "stored AS_UNIQUE" property attribute. I removed the declaration, but actual index remained in the database. What would be the proper way to remove that index? Tried DROP INDEX from backend but SQLite3 does not allow that.

Offline

#2 2018-02-11 19:13:31

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: Remove "stored AS_UNIQUE" attribute

Official documentation says that you can drop it

Offline

#3 2018-02-12 00:46:33

vlad
Member
Registered: 2017-03-20
Posts: 16

Re: Remove "stored AS_UNIQUE" attribute

In this particular case DROP INDEX returns "index associated with unique or primary key constraint cannot be dropped".

Offline

#4 2018-02-12 09:30:26

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: Remove "stored AS_UNIQUE" attribute

In such case you should create a new table t2 without an index, insert there all data from old table, drop old table and rename your new table to original name. Also yop can temporary disable constraints on SQLite3 level using PRAGMA. Altering of tables is a SQLite3 limitation.

Offline

Board footer

Powered by FluxBB