Closed jackyzy823 closed 3 years ago
Hi @jackyzy823, sorry to hear that. Thank you for the report; I've assigned this thread to the dev team for further review. 🙂
Hi @jackyzy823
Thanks for this very helpful input - awesome stuff.
At some point of the legacy syncing server life we've ditched the stable
tag in favor of latest
: https://github.com/standardnotes/syncing-server/issues/162#issuecomment-763445329
You can see that production releases were done with latest
: https://github.com/standardnotes/syncing-server/blob/master/.github/workflows/prod.yml#L54
The two migrations you've mentioned were included in the last available production version of the syncing server thus the data would've gotten the timestamps columns treatment you mentioned.
Does that solve your issue?
The two migrations you've mentioned were included in the last available production version of the syncing server thus the data would've gotten the timestamps columns treatment you mentioned.
Is syncing server
which you mentioned syncing-server:latest
(ruby) ? In syncing-server:latest
these columns is NULL
by default . items
created after this change will set these columns , but old items
will still be NULL
. If i want to move to syncing-sever-js
, that will cause syncing-sever-js
raise error Cannot read property 'toString' of null
@jackyzy823 this should be fixed with syncing-server-js:1.38.2
I've updated the standalone
to include that version. Could you do ./server.sh update
and check again if that migration process works for you from scratch?
Maybe no.
const itemsTableExists = itemsTableExistsQueryResult[0].count === '1'
and
const updatedAtTimestampColumnExists = updatedAtTimestampColumnExistsQueryResult[0].count === '1'
type of itemsTableExistsQueryResult[0].count and updatedAtTimestampColumnExistsQueryResult[0].count is number
. so the following logic will never be executed.
good catch @jackyzy823
fixed and updated standalone
with the latest version. I've tested on a db dump without the mentioned columns and seems to work fine - can you confirm and close if it's ok?
It works. Thanks for your work!
Describe the bug
It's not possible to upgrade to new architecture from docker image
syncing-server:stable
with existing data/database, becausesyncing-server:stable
is lack of an important change of columnupdated_at_timestamp
andcreated_at_timestamp
and their indexes in items . migration1 and migration2.so the structure of
items
in dumped sql is missing these two columns.However
auth
need columnupdated_at_timestamp
in items to work properly. link , and so it raise error.QueryFailedError: Unknown column 'updated_at_timestamp' in 'order clause'
syncing-server-js
do not migrate the changes to add these columns , it just defined in init db script. so it will not change existing table which we imported.When using old sql dump , there's definitely be an error
HERE might be 3 solutions.
syncing-sever:stable
. it works for methe last two lines are important for making notes' time right. (let me know if i'm wrong).
3.updateUpdate: Not work . sincesyncing-server:stable
tosyncing-server:latest
then dump database then import to new architecture. Not tested.syncing-server:latest
only add these columns , but not update these columns' value. and insyncing-server:latest
these two columns could be null and could work properly, but not work undersyncing-server-js
because it assume these two columns asNOT NULL
. Error Log:Logs