When defining property in model using 'String' or 'JSON', current code uses VARCHAR as datatype. However cassandra always uses TEXT to define the column. E.g. create table "test" ( id uuid primary key, value VARCHAR); generates table
cqlsh:test> desc table "test";
CREATE TABLE test.test (
id uuid PRIMARY KEY,
value text
) WITH bloom_filter_fp_chance = 0.01
...
Thus, when doing autoupdate, loopback-connector-cassandra always thinks there is schema change as the datatype is VARCHAR from model definition while it is TEXT from database.
In Cassandra, varchar is a synonym for text. From https://datastax-oss.atlassian.net/browse/JAVA-402, I think loopback-connector-cassandra should drop using VARCHAR to avoid unnecessary issue like migration.
Also Cassandra dropping support to alter column type today.
Related issues
Checklist
[x] New tests added or existing tests modified to cover all changes
Description
When defining property in model using 'String' or 'JSON', current code uses
VARCHAR
as datatype. However cassandra always usesTEXT
to define the column. E.g.create table "test" ( id uuid primary key, value VARCHAR);
generates tableThus, when doing
autoupdate
, loopback-connector-cassandra always thinks there is schema change as the datatype isVARCHAR
from model definition while it isTEXT
from database.In Cassandra, varchar is a synonym for text. From https://datastax-oss.atlassian.net/browse/JAVA-402, I think loopback-connector-cassandra should drop using
VARCHAR
to avoid unnecessary issue like migration.Also Cassandra dropping support to alter column type today.
Related issues
Checklist