Comments (8)
Are you using some weird postgres-ish server like cockroachdb?
from whatsmeow.
Are you using some weird postgres-ish server like cockroachdb?
I'm using cockroachdb serverless, but in the local postgres it gives the same error
from whatsmeow.
It works fine on real postgres, cockroach won't work right now because schema migrations aren't synchronous there.
from whatsmeow.
having same problem on real postgres 15.4
from whatsmeow.
Same trying to use cockroachdb here
from whatsmeow.
The error just ocurrs on upgrading database to v2 migration.
from whatsmeow.
In cockroachdb panel seems everthing right
from whatsmeow.
Now I extract the SQL statatements using ChatGPT from store/sqlstore/upgrade.go
CREATE TABLE IF NOT EXISTS whatsmeow_version (version INTEGER);
SELECT version FROM whatsmeow_version LIMIT 1;
DELETE FROM whatsmeow_version;
INSERT INTO whatsmeow_version (version) VALUES ($1);
CREATE TABLE whatsmeow_device (
jid TEXT PRIMARY KEY,
registration_id BIGINT NOT NULL CHECK (registration_id >= 0 AND registration_id < 4294967296),
noise_key bytea NOT NULL CHECK (length(noise_key) = 32),
identity_key bytea NOT NULL CHECK (length(identity_key) = 32),
signed_pre_key bytea NOT NULL CHECK (length(signed_pre_key) = 32),
signed_pre_key_id INTEGER NOT NULL CHECK (signed_pre_key_id >= 0 AND signed_pre_key_id < 16777216),
signed_pre_key_sig bytea NOT NULL CHECK (length(signed_pre_key_sig) = 64),
adv_key bytea NOT NULL,
adv_details bytea NOT NULL,
adv_account_sig bytea NOT NULL CHECK (length(adv_account_sig) = 64),
adv_device_sig bytea NOT NULL CHECK (length(adv_device_sig) = 64),
platform TEXT NOT NULL DEFAULT '',
business_name TEXT NOT NULL DEFAULT '',
push_name TEXT NOT NULL DEFAULT ''
);
CREATE TABLE whatsmeow_identity_keys (
our_jid TEXT,
their_id TEXT,
identity bytea NOT NULL CHECK (length(identity) = 32),
PRIMARY KEY (our_jid, their_id),
FOREIGN KEY (our_jid) REFERENCES whatsmeow_device(jid) ON DELETE CASCADE ON UPDATE CASCADE
);
-- Other CREATE TABLE statements similar to the ones above.
ALTER TABLE whatsmeow_device ADD COLUMN adv_account_sig_key bytea CHECK (length(adv_account_sig_key) = 32);
UPDATE whatsmeow_device SET adv_account_sig_key = (
SELECT identity FROM whatsmeow_identity_keys
WHERE our_jid = whatsmeow_device.jid AND their_id = concat(split_part(whatsmeow_device.jid, '.', 1), ':0')
);
-- Other SQL statements for PostgreSQL or SQLite specific updates.
CREATE TABLE whatsmeow_message_secrets (
our_jid TEXT,
chat_jid TEXT,
sender_jid TEXT,
message_id TEXT,
key bytea NOT NULL,
PRIMARY KEY (our_jid, chat_jid, sender_jid, message_id),
FOREIGN KEY (our_jid) REFERENCES whatsmeow_device(jid) ON DELETE CASCADE ON UPDATE CASCADE
);
Apparantly cockroachdb doesn't runs update and delete on databases
from whatsmeow.
Related Issues (20)
- How to detect message sent from another device but same account as whatsmeow HOT 1
- pq: column "facebook_uuid" does not exist HOT 2
- How to know when the contact list was fully sync after QR code scan? HOT 1
- Error in Paring Device with QR HOT 26
- How to reply a group message HOT 6
- Message.ExtendedTextMessage.ContextInfo.EntryPointConversionSource empty HOT 1
- Text message sometimes empty string HOT 5
- Connected, but registering device +... ⏳ Waiting for code...XXXX-XXXX HOT 3
- timeout running - Getting Issue While QR Scan Call Open HOT 5
- Not working when setting DeviceProps_HistorySyncConfig HOT 3
- go 12.1 not support window 7 HOT 1
- Client outdated (405) connect failure (client version: 2.2329.9) HOT 1
- Audio VN (PTT) cant play in iOS HOT 1
- List Message not working HOT 6
- Goroutines use a lot of RAM memory after this error HOT 1
- No new message notification on phone if message received in whatsmeow HOT 11
- Re-request media from phone HOT 1
- Questions about database HOT 3
- I have an account with a 6-segment key, how do I use it to log in to WhatsApp?
- Contact name HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from whatsmeow.