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

[SQLite] dropChecks not supported #5326

Closed
barakplasma opened this issue Sep 12, 2022 · 0 comments
Closed

[SQLite] dropChecks not supported #5326

barakplasma opened this issue Sep 12, 2022 · 0 comments

Comments

@barakplasma
Copy link

barakplasma commented Sep 12, 2022

it('drop checks', function () {
tableSql = client
.schemaBuilder()
.table('user', function (t) {
t.dropChecks(['check_constraint1', 'check_constraint2']);
})
.toSQL();
expect(tableSql[0].sql).to.equal(
'alter table `user` drop constraint check_constraint1, drop constraint check_constraint2'
);
});

will always fail since there isn't support for alter table foo drop constraint in sqlite3 directly.

$ sqlite3
SQLite version 3.37.2 2022-01-06 13:25:41
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> create table foo (id integer primary key, bar integer check(bar > 1));
sqlite> insert into foo values (1, 2);
sqlite> insert into foo values (1, -1);
Error: stepping, CHECK constraint failed: bar > 1 (19)
sqlite> alter table foo drop constraint;
Error: in prepare, near "constraint": syntax error (1)
sqlite> alter table foo drop constraint bar;
Error: in prepare, near "constraint": syntax error (1)
sqlite> alter table foo drop constraint 1;
Error: in prepare, near "constraint": syntax error (1)
sqlite> 

relates to #4874

@barakplasma barakplasma changed the title [SQLite] dropChecks silently fails [SQLite] dropChecks not supported Sep 12, 2022
@barakplasma barakplasma closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2023
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