how to version multiple tables with dexie 3.0, when users may jump from any previous version to the latest? - node.js

After studying the Dexie documentation on versioning, I am unclear about some aspects of versioning using Dexie 3.0.1.
Suppose I have table1 and table2 with only id as an index on each for version 1 of my db:
db.version(1).stores({table1: "++id", table2: "++id"});
For version 2 of my db, I add shoeSize as an index of table1:
db.version(2).stores({table1: "++id,shoeSize"});
For version 3 of my db, I add dateOfBirth as an index of table2.
db.version(3).stores({table2: "++id,dateOfBirth"});
If I understand correctly, for Dexie 3.0, my final code should only have the last change to stores: db.version(3).stores({table2: "++id,dateOfBirth"});. It will NOT have version 2: db.version(2).stores({table1: "++id,shoeSize"});.
So, if a user installs version 1 of my app, then upgrades directly to version 3, how will his table1 get updated to have the shoeSize index? How should I handle versioning multiple tables with Dexie 3.0?

Related

last_login field has removed from django user model

I am using django admin application. I just migrated jango 1.9 to Django 3.1.1. And Using python 3.6
During Django migration it would expects an additional arguments as "on_delete". So, I updated this arguments to all my models.
After modified models I just do "makemigrations" and "migrate" this all should fine without any issues.
And, I could see that "last_login" column as missed in my table. When debugging I could see this in migrations file
operations = [
migrations.RemoveField(
model_name='user',
name='last_login',
)]
Questions
Why this column has removed?
How to add this field to user model again

Postgis - migration from 1.5 to 2.3 - workaround

Fellows,
I already had a really hard time trying to make a migration from a postgis 1.5 to 2.3. Actually I had many attempts to do that with all version of postgis: 2.0, 2.1, 2.2 and now 2.3.
As I have spent a few weeks with that, and as I am ready to drop that I keep using my old version of postgresql and postgis, I hope my question finds a echo somewhere...
I only want to migrate one table field, a geometry field. So before trying to do that, I would like to hear if any of you have experience with that:
The idea is to select the field from the old postgis (postgresql 9.2, postgis 1.5), and update the table to the new postgis (postgresql 9.6, postgis 2.3).
Anyone can say anything about it?
EDIT---
I have just tryed to import the table I needed, but I got an error:
violation of constraint "enforce_srid_the_geom".
:(
Thanks a lot.
If you need to migrate just a single table with a geometry column and you are getting troubles with the procedure described here http://www.postgis.org/docs/postgis_installation.html#hard_upgrade
I'd suggest a workaround: create a text field in the old db, e.g. wkt_geom, then execute
update tablename set wkt_geom = st_astext(the_geom)
Now drop the geometry column, export the old db and import into the new one. Then, create the geometry column and
update tablename set the_geom = st_geomfromtext(wkt_geom, SRID_HERE)

Cassandra - Update Timestamp column not working properly

Trying to update Timestamp column in Cassandra database.
update sample set date='2016-10-21 19:15:10.000' where rowkey=1;
When i check the results, it is less than 5:30 hours.
Output:
2016-10-21 13:45:10.000000+0000
Is it something to do with Locale?, i tried to update the same using programmatically, the same output.
That's because cqlsh shows timestamps only in UTC as per CASSANDRA-10000 in versions 2.1.9, 2.2.1, and 3.0 (beta). It was fixed to show timestamps while applying the local timezone offset in CASSANDRA-10397 as of versions 2.2.6, 3.0.4, 3.4.
If this is an issue for you, an upgrade to a recent version of Cassandra should correct this behavior.

Cassandra no viable alternative at input Like

I am very new to Cassandra and am trying to use the new LIKE feature but keep getting the error
Line 1: no viable alternative at input 'LIKE'
I am using DataStax DevCenter and am following the examples on https://docs.datastax.com/en/cql/3.3/cql/cql_using/useSASIIndex.html .I am using Cassandra version 3.7.0 and CQL 3.4.2 and the Datastex version is 1.60 community . I have a table named zips with a text field called city that has 10,000 records and am simply using this CQL code
SELECT * FROM "MyTable".zips WHERE city LIKE 'M%';
Before that I added an index using
CREATE CUSTOM INDEX fn_prefix ON "MyTable".zips (city) USING 'org.apache.cassandra.index.sasi.SASIIndex';
I know that the index worked because it allowed me to do this query
SELECT * FROM "Exoler".zips WHERE city='Miami';
without using allow filter and it returns values. Any suggestions would be great as stated I am very new to this.
If you use Cassandra 3.9 and Datastax DevCenter version 1.5.0 or 1.6.0 it won't support LIKE (atleast on Windows). The result is only "no viable alternative at input 'LIKE'"
But it works fine if you use command prompt:
WINDOWS-Key
cmd
"%CASSANDRA_HOME%\bin\cqlsh"
It is just a bug in Datastax DevCenter I guess.

Strange directory structure after upgrade cassandra dse to 4.8.5

I've just upgraded my dse cluster to the newest version of dse (4.8.5).
After upgrade and first backup taken by opscenter i noticed that dir of my keyspace has strange subdirectories. Before it was only subdirectories with name corresponding to name of column family, but now there are extra subdirectories which names begins with the column family name and end with some id. For exapmle:
adresse
adresse-489b600c299634da953e3102af80b02b
but i have only column family: adresse.
Could you explain this strange behaviour?
Thanks
Przemek
What is your previous version of Cassandra? Are you aware of columnFamily id?
I found answer. In Cassandra 2.0 dir for snapshots was: data_directory_location/keyspace_name/table_name/snapshots/snapshot_name but in cassandra 2.1 is: data_directory_location/keyspace_name/table_name-UUID/snapshots/snapshot_name

Resources