Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALTER TABLE ALTER COLUMN on tables with indexes do not work #1299

Open
robinjonsson opened this issue Apr 10, 2024 · 0 comments
Open

ALTER TABLE ALTER COLUMN on tables with indexes do not work #1299

robinjonsson opened this issue Apr 10, 2024 · 0 comments

Comments

@robinjonsson
Copy link

Libsql will throw an error if you try to alter a column in a table that has indexes.

CREATE TABLE `t1` (
    `c1` text,
    `c2` text
);
CREATE INDEX `t1_c1_idx` ON `t1` (`c1`);

ALTER TABLE t1 ALTER COLUMN c2 TO c2 TEXT DEFAULT 'test';
Query 1 ERROR at Line 6: : [{"error":"error in adding c2 TEXT DEFAULT 'test' to t1: Only ordinary tables can be altered, not indexes"}]

Tested in version: v0.23.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant