Strange error when running platformatic after migration applied
See original GitHub issueI have the following migration:
`CREATE TABLE IF NOT EXISTS main.tenant ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, logo TEXT NULL );
CREATE TABLE IF NOT EXISTS main.user ( id INTEGER PRIMARY KEY, login TEXT NOT NULL, password TEXT NOT NULL, is_admin BOOLEAN NOT NULL default false );
CREATE TABLE IF NOT EXISTS main.customer ( id INTEGER PRIMARY KEY, nome TEXT NOT NULL, cpf VARCHAR(14) UNIQUE NOT NULL, telefone VARCHAR(13) UNIQUE NOT NULL, user_id INTEGER REFERENCES main.user(id) );
CREATE TABLE IF NOT EXISTS main.professional ( id INTEGER PRIMARY KEY, nome TEXT NOT NULL, telefone VARCHAR(13) UNIQUE NOT NULL, user_id INTEGER REFERENCES main.user(id), tenant_id INTEGER REFERENCES main.tenant(id) );
CREATE TABLE IF NOT EXISTS main.address ( id INTEGER PRIMARY KEY, public_area VARCHAR NOT NULL, number VARCHAR(5) NULL, city TEXT NOT NULL, state VARCHAR(2) NOT NULL, country TEXT NOT NULL, zip_code TEXT NULL, complement TEXT NULL );
CREATE TABLE IF NOT EXISTS main.place ( id INTEGER PRIMARY KEY, address_id INTEGER REFERENCES main.address(id) NOT NULL, tenant_id INTEGER REFERENCES main.tenant(id) );
CREATE TABLE IF NOT EXISTS main.scheduling ( id INTEGER PRIMARY KEY, start_time TIME NOT NULL, end_time TIME NOT NULL, day DATE NOT NULL, description TEXT, place_id INTEGER REFERENCES main.place(id) NOT NULL ); `
When I run the platformatic the tables are created correctly but after that I have this error:
TypeError: Cannot read properties of undefined (reading ‘reverseRelationships’) at setupOpenAPI (/home/cleiton/projetos/kairos/backend/node_modules/@platformatic/sql-openapi/index.js:61:56) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Edit: The main schema was created by a previous migration.
Issue Analytics
- State:
- Created 9 months ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Thanks, we’ll check these bugs asap.
I forget to include. I’m having this problem when I disable graphql. When I enable graphql I have another error: