question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Strange error when running platformatic after migration applied

See original GitHub issue

I 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:closed
  • Created 9 months ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mcollinacommented, Dec 9, 2022

Thanks, we’ll check these bugs asap.

1reaction
clluizcommented, Dec 8, 2022

I forget to include. I’m having this problem when I disable graphql. When I enable graphql I have another error:

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix for the relationships for tables in different schemas #521
Successfully merging this pull request may close these issues. Strange error when running platformatic after migration applied. 2 participants.
Read more >
Django Programming error column does not exist even after ...
I got the same problem (column not exist) but when I try to run migrate not with makemigrations (it is the same issue...
Read more >
Migration troubleshooting in production - Prisma
The following guide describes issues relating to Prisma Migrate that can occur in production, and how to resolve them. This guide does not...
Read more >
Diagnosing Migration Issues | GridPane
Layered Caches; OpenLiteSpeed Syntax Errors After Migration ... Strange Behaviour/Redirects: Check for Two Competing wp-config.php Files.
Read more >
Error during DB migration - Google Groups
While trying to upgrade NetBox 2.3.7 to 2.4.3 I got an error during DB migration. After ./upgrade.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found